Consent Manager Provider
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.
Options Reference
Warning: ExtractedTypeTable: Could not extract "CommonInlineStoreOptions" from "./packages/ui/src/theme/options.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.
Warning: ExtractedTypeTable: Could not extract "ConsentManagerContentOptions" from "./packages/ui/src/theme/options.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.
Warning: ExtractedTypeTable: Could not extract "UIOptions" from "./packages/ui/src/theme/types.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.
Content Security Policy
c15t injects a <style id="c15t-theme"> element for your theme tokens, and the script loader injects a <script> element per consented vendor. Under a nonce-based Content Security Policy, both are blocked unless they carry your nonce.
Pass it once through the nonce option and c15t applies it to everything it injects:
A nonce set on an individual script definition still wins, so you can override a single vendor without changing the provider.
Info
Browsers hide the nonce content attribute once a policy is active. Inspecting the element shows no nonce="", but element.nonce still returns the value — this is expected and not a sign that c15t dropped it.
Inline style attributes
The nonce option covers the elements c15t injects. It cannot cover inline style="..." attributes, which several components rely on — a nonce never authorizes a style attribute, because nonces apply to elements only.
Style attributes are governed by style-src-attr, and when that directive is absent CSP falls back to style-src. A nonce-based style policy therefore blocks them:
To keep the nonce requirement for stylesheets while still allowing style attributes, set style-src-attr explicitly:
Warning
'unsafe-inline' on style-src-attr permits any inline style attribute on the page. That is weaker than a nonce, but far narrower than replacing your nonce-based style-src with 'unsafe-inline', which would additionally authorize arbitrary injected <style> elements. Note that adding 'unsafe-inline' alongside a nonce achieves nothing — a directive that specifies a nonce ignores it. If your threat model does not allow this, expect components that use inline styles to render unstyled.
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:
Warning
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.
Props
Warning: ExtractedTypeTable: Could not extract "ConsentManagerProviderProps" from "./packages/react/src/types/consent-manager.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.