useConsentManager

The primary hook for accessing consent state and actions. Returns the full consent store including all state properties and action methods.

useConsentManager() is the primary hook for interacting with the consent system. It returns the complete consent store state and all action methods.

Info

Must be used within a ConsentManagerProvider. Throws an error if used outside the provider.

State Properties

Loading…

Action Methods

Loading…

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 only works in 'c15t' mode — in 'offline' mode the call is a no-op.

Key Types

ConsentState

A record mapping consent category names to their boolean values:

ConsentInfo

Metadata about when and how consent was recorded:

LocationInfo

Detected geographic location from the c15t backend:

Model

The 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 mode
  • null — No jurisdiction detected yet