ConsentManagerProvider
ConsentManagerProvider is the root component for the c15t consent system. It initializes the consent store, detects the user's jurisdiction, resolves translations, and provides consent state to all child components via React context.
Every other c15t component and hook must be rendered inside this provider.
Basic Usage
Options Reference
Mode: hosted vs offline
See Client Modes for a detailed comparison.
Legal Links
legalLinks defines the URLs shown in consent UI text (banner, dialog, and widget where applicable).
Configure only the links you want to expose.
Notes:
- Omitting a key (for example
termsOfService) hides that link. labeloverrides the translated text for that single link.- Use
_selffor internal pages and_blank+rel="noopener noreferrer"for external pages. - Control which of the configured links render in each component via the component's
legalLinksprop.
Overrides
overrides lets you force location/language signals instead of browser or network detection.
This is useful for QA, local development, and preview environments.
You can also override Global Privacy Control (GPC) behavior during testing:
Info
Treat overrides as an environment/testing tool. Avoid hard-coding production overrides unless that behavior is intentional for your deployment.
Policy Packs
In hosted mode (recommended), the backend resolves the correct policy automatically — no frontend policy config needed:
Fallback: Offline Policies
When no backend is available, ConsentManagerProvider accepts offlinePolicy.policyPacks for local policy resolution during development, testing, previews, or temporary backend outages:
Notes:
offlinePolicyis only used inofflinemode.- Treat offline policies as a development/testing tool or resilience fallback, not the primary production source of truth.
offlinePolicy.i18nlets offline mode mirror hostedmessageProfileand profile-localfallbackLanguagebehavior.- Omitting
offlinePolicy.policyPacksuses the built-in synthetic opt-in fallback banner. Hosted network fallback uses the same opt-in banner. offlinePolicy: { policyPacks: [] }is explicit no-banner mode.- In hosted mode, backend
policyPacksremain the source of truth — frontend offline policies never override a live backend decision.
Read the full guide at Policy Packs and the conceptual model at Policy Packs Concept.