trackkit / consent/types / ConsentOptions
Interface: ConsentOptions
Defined in: consent/types.ts:66
High-level configuration for the consent manager.
These options control:
- how initial consent is derived,
- whether explicit action is required,
- and how persistence/versioning behaves.
Properties
initialStatus?
optionalinitialStatus:ConsentStatus
Defined in: consent/types.ts:73
Initial consent status when no stored state exists.
If omitted, Trackkit will derive an appropriate default based on ConsentOptions.requireExplicit and other settings.
requireExplicit?
optionalrequireExplicit:boolean
Defined in: consent/types.ts:82
If true, the consent manager starts as 'pending' and requires an explicit grant call.
If false, consent may be auto-granted on first track (implicit consent) depending on your policy.
allowEssentialOnDenied?
optionalallowEssentialOnDenied:boolean
Defined in: consent/types.ts:91
When true, essential events may still be allowed when consent is explicitly denied.
This typically covers things like security logging and critical operational telemetry.
policyVersion?
optionalpolicyVersion:string
Defined in: consent/types.ts:99
Current policy/version identifier.
If a stored ConsentStoredState.version is less than this, the manager should re-prompt (by resetting status to 'pending').
disablePersistence?
optionaldisablePersistence:boolean
Defined in: consent/types.ts:107
Disable all persistence.
When true, consent state is never written to storage and always starts from ConsentOptions.initialStatus on each page load.
storageKey?
optionalstorageKey:string
Defined in: consent/types.ts:115
Custom storage key to use when persisting consent state.
Useful when running multiple independent consent managers or when migrating from a legacy key.