Consent Management

Privacy

Manage user consent for GDPR, CCPA, and other privacy regulations.

GDPR Compliant

EU privacy regulation ready

CCPA Ready

California privacy law support

Audit Trail

Complete consent history

GPC Support

Global Privacy Control signal

Privacy Settings Component

Let users update their consent at any time:

Settings page component
'use client'

import { useConsent } from '@sylphx/platform-sdk/react'

export function PrivacySettings() {
  const { consentTypes, setConsents, isLoading } = useConsent()

  const handleChange = async (typeId: string, granted: boolean) => {
    await setConsents({ [typeId]: granted })
  }

  if (isLoading) return <div>Loading...</div>

  return (
    <div>
      <h2>Privacy Settings</h2>
      {consentTypes.map((type) => (
        <label key={type.id} className="block py-3 border-b">
          <div className="flex items-center justify-between">
            <div>
              <span className="font-medium">{type.name}</span>
              <p className="text-sm text-muted-foreground">{type.description}</p>
            </div>
            <input
              type="checkbox"
              checked={type.granted}
              disabled={type.required}
              onChange={(e) => handleChange(type.id, e.target.checked)}
            />
          </div>
        </label>
      ))}
    </div>
  )
}

Data Deletion

Handle GDPR data deletion requests:

// User requests data deletion
await platform.privacy.requestDeletion({
  userId: user.id,
  reason: 'User requested account deletion',
})

// The platform will:
// 1. Queue all user data for deletion
// 2. Send confirmation email
// 3. Delete data within 30 days
// 4. Notify your webhook when complete

Irreversible

Data deletion is permanent and cannot be undone. Make sure to confirm with the user before proceeding.

GPC Signal

Respect the Global Privacy Control signal:

import { useConsent } from '@sylphx/platform-sdk/react'

function App() {
  const { gpcEnabled } = useConsent()

  // GPC signal is automatically detected
  // If enabled, optional consents default to false
  if (gpcEnabled) {
    console.log('GPC detected - respecting user preference')
  }
}