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

Loading…
Loading…
Loading…

Mode: hosted vs offline

See Client Modes for a detailed comparison.

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.
  • label overrides the translated text for that single link.
  • Use _self for internal pages and _blank + rel="noopener noreferrer" for external pages.
  • Control which of the configured links render in each component via the component's legalLinks prop.

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:

  • offlinePolicy is only used in offline mode.
  • Treat offline policies as a development/testing tool or resilience fallback, not the primary production source of truth.
  • offlinePolicy.i18n lets offline mode mirror hosted messageProfile and profile-local fallbackLanguage behavior.
  • Omitting offlinePolicy.policyPacks uses 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 policyPacks remain 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.

Props

Loading…