useConsentManager
useConsentManager() is the primary hook for interacting with the consent system. It returns the complete consent store state and all action methods.
Warning
Must be used within a ConsentManagerProvider. Throws an error if used outside the provider.
State Properties
Warning: ExtractedTypeTable: Could not extract "StoreRuntimeState" from "./packages/core/src/store/type.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.
Action Methods
Warning: ExtractedTypeTable: Could not extract "StoreActions" from "./packages/core/src/store/type.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.
identifyUser
The identifyUser() method links anonymous consent records to an authenticated user. Call it after a user logs in to associate their consent preferences with their account.
Info
identifyUser sends the user data to the c15t backend. It works in hosted
mode, including the legacy alias mode: 'c15t'. In mode: 'offline', the
call is a no-op.
Key Types
ConsentState
ConsentStateA record mapping consent category names to their boolean values:
ConsentInfo
ConsentInfoMetadata about when and how consent was recorded:
LocationInfo
LocationInfoDetected geographic location from the c15t backend:
Model
ModelThe active consent model:
'opt-in'— Explicit consent required before tracking (GDPR)'opt-out'— Tracking allowed by default, user can opt out (CCPA)'iab'— IAB TCF 2.3 compliance modenull— No jurisdiction detected yet