Skip to main content

Documentation

Documentation

Rename options and components

v2v3
translationsi18n
backendURL, mode: 'hosted'mode: hosted({ backendURL }) from c15t/react on ConsentProvider. Next.js ConsentRoot: NEXT_PUBLIC_C15T_BACKEND_URL and c15t.config.ts.
ssrData (Next.js)ConsentRoot with state from resolveConsent()
iframeBlockerConfigiframeBlocker, or false to turn it off
Frame, FrameRoot, FrameTitle, FrameButton, FramePropsConsentGate and its parts. The Frame names still work as deprecated aliases and log a one-time warning outside production.
frame translations, such as frame.titleconsentGate, such as consentGate.title. Copy under frame still applies and logs a warning outside production.
FrameTranslationsConsentGateTranslations. FrameTranslations still works as a deprecated alias.
--frame-* CSS variables--consent-gate-*, with the same suffixes, such as --consent-gate-placeholder-background-color. The old names no longer apply.
YouTubeEmbed, GoogleMapRemoved. Wrap your own embed in ConsentGate.
useConsentScript()Removed. Register the script in scripts with a @c15t/integrations helper.
useSSRStatus()Removed
ConsentButtonRemoved. Use the ConsentBanner and ConsentWidget buttons, or call useHeadlessConsentUI() from your own button.
@c15t/react/cookie-bannerc15t/react/consent-banner
retryConfigRemoved
store, including namespace, debug, initialConsentCategories and initialTranslationConfigRemoved. Use the top-level consentCategories and i18n options. Debug information is on window.c15t.
window.c15tStorewindow.c15t
iab: iab({ ... })IABProvider. See Move IAB setup.

The consent-provider-options codemod renames ConsentManagerProvider and its option and prop types, turns mode and backendURL into hosted() or offline(), and renames iframeBlockerConfig. v2 still accepted the deprecated translations option; the translations-to-i18n codemod moves it to i18n.

npx @c15t/cli codemods consent-provider-options translations-to-i18n --dry-run --json

ConsentBanner, ConsentDialog, ConsentDialogLink, ConsentDialogTrigger and ConsentWidget keep their names. The scripts, networkBlocker, legalLinks, overrides, theme and colorScheme options keep theirs too, but theme tokens no longer produce CSS on their own. See Update styles and themes.

persistence and storageConfig are read once, when the provider mounts. v2 moved a stored choice when the storage key changed. Remount the provider to change storage. Reading a vendor that nothing declares, through vendors, a script or the backend, returns false.

Some names left the root c15t/react entry:

v2 import from the rootv3 import
useHeadlessConsentUI, useConsentDialogTrigger, useColorScheme, useFocusTrap and the translation helpersc15t/react/headless
Flat banner parts such as ConsentBannerCard and ConsentBannerAcceptButtonConsentBanner.Card, ConsentBanner.AcceptButton and the other compound parts, or the same names from c15t/react/components/consent-banner
TriggerRoot, TriggerButton, TriggerIcon, TriggerText, useTriggerContext, useDraggablec15t/react/consent-dialog-trigger
Token types such as ColorTokens and TypographyTokensc15t/react/types. Theme stays on the root.
configureConsentManager, policyPackPresets, ConsentStoreState, ConsentManagerInterfaceRemoved. Use policyRulePresets from c15t.

The root-exports-to-subpaths codemod moves these imports to their new entries and marks removed names with a TODO(c15t v3) comment:

npx @c15t/cli codemods root-exports-to-subpaths --dry-run --json

ConsentGate changes one behavior from Frame. When its category is granted, the embed now mounts after hydration instead of in the server HTML, so an iframe loads once instead of twice. Size the wrapper with className or style to hold its space. Test ids change from frame-placeholder and frame-open-dialog to consent-gate-placeholder and consent-gate-button.