@c15t/react 3.0.0-alpha.0 → 3.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +96 -69
- package/README.md +21 -17
- package/SKILL.md +34 -0
- package/dist/aggregate-components.js +1 -1
- package/dist/chunk-warming.js +1 -1
- package/dist/component-hooks/use-headless-consent-ui.js +1 -1
- package/dist/component-hooks/use-headless-iab-consent-ui.js +1 -1
- package/dist/component-hooks/use-panel-trigger.js +1 -1
- package/dist/components/consent-gate/atoms.js +1 -0
- package/dist/components/consent-gate/consent-gate.js +2 -0
- package/dist/components/consent-gate/frame.js +2 -0
- package/dist/components/consent-gate/index.js +2 -0
- package/dist/components/consent-preferences-link/consent-preferences-link.js +1 -1
- package/dist/components/iab-panel/atoms/card.js +1 -1
- package/dist/components/iab-panel/atoms/feature-item.js +2 -0
- package/dist/components/iab-panel/atoms/header.js +1 -1
- package/dist/components/iab-panel/atoms/purpose-item.js +1 -1
- package/dist/components/iab-panel/atoms/root.js +1 -1
- package/dist/components/iab-panel/atoms/stack-item.js +1 -1
- package/dist/components/iab-panel/atoms/vendor-list.js +1 -1
- package/dist/components/iab-panel/hooks/use-gvl-data.js +1 -1
- package/dist/components/iab-panel/iab-panel.js +1 -1
- package/dist/components/iab-panel/index.js +1 -1
- package/dist/components/iab-prompt/atoms/overlay.js +1 -1
- package/dist/components/iab-prompt/atoms/root.js +1 -1
- package/dist/components/panel/atoms/card.js +1 -1
- package/dist/components/panel/atoms/overlay.js +1 -1
- package/dist/components/panel/atoms/root.js +1 -1
- package/dist/components/panel/panel.js +1 -1
- package/dist/components/panel-trigger/atoms/button.js +1 -1
- package/dist/components/panel-trigger/atoms/icon.js +1 -1
- package/dist/components/panel-trigger/atoms/root.js +1 -1
- package/dist/components/panel-trigger/atoms/toolbar.js +1 -1
- package/dist/components/panel-trigger/atoms/trigger-icons.js +1 -0
- package/dist/components/panel-trigger/panel-trigger-toolbar.js +1 -1
- package/dist/components/panel-trigger/panel-trigger.js +1 -1
- package/dist/components/preferences/atoms/accordion.js +1 -1
- package/dist/components/preferences/atoms/root.js +1 -1
- package/dist/components/preferences/atoms/vendor-list.js +1 -0
- package/dist/components/preferences/index.js +1 -1
- package/dist/components/prompt/atoms/early-tap-script.js +2 -0
- package/dist/components/prompt/atoms/overlay.js +1 -1
- package/dist/components/prompt/atoms/root.js +1 -1
- package/dist/components/prompt/components.js +1 -1
- package/dist/components/prompt/policy-actions.js +1 -1
- package/dist/components/prompt/prompt.js +1 -1
- package/dist/components/shared/dialog-sheets.js +1 -0
- package/dist/components/shared/first-paint-sheets.js +1 -0
- package/dist/components/shared/iab-dialog-sheets.js +1 -0
- package/dist/components/shared/iab-first-paint-sheets.js +1 -0
- package/dist/components/shared/libs/compose-refs.js +1 -0
- package/dist/components/shared/libs/slot.js +1 -1
- package/dist/components/shared/primitives/button.js +1 -1
- package/dist/components/shared/primitives/legal-links/index.js +1 -1
- package/dist/components/shared/streamed-surface.js +2 -0
- package/dist/components/shared/surface-styles.js +2 -0
- package/dist/components/shared/ui/dialog/dialog.js +1 -1
- package/dist/components/shared/ui/icon.js +1 -1
- package/dist/components/shared/ui/logo.js +1 -1
- package/dist/components/shared/ui/preference-item/preference-item.js +1 -1
- package/dist/consent-gate.js +2 -0
- package/dist/consent-theme.js +1 -0
- package/dist/context/consent-tracking-context.js +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context.js +1 -1
- package/dist/devtools-launcher.js +2 -0
- package/dist/devtools.js +1 -1
- package/dist/draft-context.js +2 -0
- package/dist/draft.js +1 -1
- package/dist/external-iab-context.js +1 -1
- package/dist/gpp.js +2 -0
- package/dist/headless.js +1 -1
- package/dist/hooks/use-color-scheme.js +1 -1
- package/dist/hooks/use-committed-ref.js +2 -0
- package/dist/hooks/use-focus-trap.js +1 -1
- package/dist/hooks/use-headless-iab-consent-ui.js +1 -1
- package/dist/hooks/use-iab-policy-guard.js +1 -0
- package/dist/hooks/use-late-entry.js +2 -0
- package/dist/hooks.js +1 -1
- package/dist/iab/styles.tw3.css +5 -151
- package/dist/iab-context.js +1 -1
- package/dist/index-parts/consent-banner.js +1 -0
- package/dist/index-parts/consent-dialog-link.js +1 -0
- package/dist/index-parts/consent-dialog-trigger.js +1 -0
- package/dist/index-parts/consent-dialog.js +1 -0
- package/dist/index-parts/consent-gate.js +1 -0
- package/dist/index-parts/core.js +1 -0
- package/dist/index-parts/draft.js +1 -0
- package/dist/index-parts/frame.js +1 -0
- package/dist/index-parts/hooks.js +1 -0
- package/dist/index-parts/hosted.js +1 -0
- package/dist/index-parts/module-hooks.js +1 -0
- package/dist/index-parts/offline.js +1 -0
- package/dist/index-parts/presets.js +1 -0
- package/dist/index-parts/provider.js +1 -0
- package/dist/index-parts/theme.js +1 -0
- package/dist/index-parts/translations.js +1 -0
- package/dist/index.js +1 -1
- package/dist/kernel-selector.js +1 -0
- package/dist/modes.js +1 -0
- package/dist/module-hooks/iframe-blocker.js +1 -1
- package/dist/module-hooks/network-blocker.js +1 -1
- package/dist/module-hooks/network-hold.js +2 -0
- package/dist/module-hooks/persistence.js +1 -1
- package/dist/panel-link.js +1 -1
- package/dist/panel-trigger.js +1 -1
- package/dist/panel.js +1 -1
- package/dist/postcss-tailwind3.js +1 -0
- package/dist/preferences.js +1 -2
- package/dist/provider.js +1 -1
- package/dist/server/fetch-ssr-data.js +1 -1
- package/dist/server/headers.js +1 -1
- package/dist/server/normalize-url.js +1 -1
- package/dist/styles.tw3.css +35 -159
- package/dist/transports/hosted.js +1 -0
- package/dist/transports/manifest.js +1 -0
- package/dist/transports/offline.js +1 -1
- package/dist/utils/deferred-module.js +2 -0
- package/dist/utils/merge-slot-props.js +1 -1
- package/dist/utils/theme-utils.js +1 -1
- package/dist/version.js +1 -1
- package/dist-types/aggregate-components.d.ts +2 -2
- package/dist-types/chunk-warming.d.ts +45 -8
- package/dist-types/component-hooks/use-headless-consent-ui.d.ts +5 -5
- package/dist-types/component-hooks/use-headless-iab-consent-ui.d.ts +2 -2
- package/dist-types/components/consent-gate/atoms.d.ts +11 -0
- package/dist-types/components/consent-gate/consent-gate.d.ts +2 -0
- package/dist-types/components/consent-gate/frame.d.ts +19 -0
- package/dist-types/components/consent-gate/index.d.ts +25 -0
- package/dist-types/components/{frame → consent-gate}/types.d.ts +7 -7
- package/dist-types/components/consent-preferences-link/consent-preferences-link.d.ts +1 -1
- package/dist-types/components/consent-preferences-link/index.d.ts +1 -1
- package/dist-types/components/iab-panel/atoms/feature-item.d.ts +28 -0
- package/dist-types/components/iab-panel/atoms/purpose-item.d.ts +5 -2
- package/dist-types/components/iab-panel/atoms/stack-item.d.ts +7 -2
- package/dist-types/components/iab-panel/atoms/vendor-list.d.ts +1 -1
- package/dist-types/components/iab-panel/iab-panel.d.ts +3 -3
- package/dist-types/components/iab-panel/index.d.ts +29 -26
- package/dist-types/components/iab-panel/use-iab-translations.d.ts +4 -0
- package/dist-types/components/iab-prompt/iab-prompt.d.ts +3 -3
- package/dist-types/components/iab-prompt/index.d.ts +19 -19
- package/dist-types/components/panel/atoms/card.d.ts +5 -4
- package/dist-types/components/panel/atoms/overlay.d.ts +1 -1
- package/dist-types/components/panel/index.d.ts +8 -8
- package/dist-types/components/panel/panel.d.ts +3 -3
- package/dist-types/components/panel-link/index.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/button.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/icon.d.ts +1 -1
- package/dist-types/components/panel-trigger/atoms/root.d.ts +2 -2
- package/dist-types/components/panel-trigger/atoms/toolbar.d.ts +2 -2
- package/dist-types/components/panel-trigger/atoms/trigger-icons.d.ts +25 -0
- package/dist-types/components/panel-trigger/index.d.ts +4 -4
- package/dist-types/components/panel-trigger/panel-trigger-toolbar.d.ts +1 -1
- package/dist-types/components/panel-trigger/panel-trigger.d.ts +9 -17
- package/dist-types/components/panel-trigger/types.d.ts +1 -1
- package/dist-types/components/preferences/atoms/accordion.d.ts +6 -4
- package/dist-types/components/preferences/atoms/button.d.ts +1 -1
- package/dist-types/components/preferences/atoms/footer.d.ts +1 -1
- package/dist-types/components/preferences/atoms/root.d.ts +1 -1
- package/dist-types/components/preferences/atoms/vendor-list.d.ts +23 -0
- package/dist-types/components/preferences/index.d.ts +14 -12
- package/dist-types/components/preferences/policy-actions.d.ts +2 -2
- package/dist-types/components/preferences/preferences.d.ts +1 -1
- package/dist-types/components/preferences/types.d.ts +1 -1
- package/dist-types/components/prompt/atoms/early-tap-script.d.ts +17 -0
- package/dist-types/components/prompt/atoms/root.d.ts +4 -0
- package/dist-types/components/prompt/components.d.ts +9 -3
- package/dist-types/components/prompt/index.d.ts +12 -12
- package/dist-types/components/prompt/policy-actions.d.ts +2 -2
- package/dist-types/components/prompt/prompt.d.ts +5 -1
- package/dist-types/components/shared/dialog-sheets.d.ts +9 -0
- package/dist-types/components/shared/first-paint-sheets.d.ts +8 -0
- package/dist-types/components/shared/iab-dialog-sheets.d.ts +3 -0
- package/dist-types/components/shared/iab-first-paint-sheets.d.ts +3 -0
- package/dist-types/components/shared/libs/compose-refs.d.ts +20 -0
- package/dist-types/components/shared/policy-actions.d.ts +2 -2
- package/dist-types/components/shared/primitives/box.d.ts +1 -1
- package/dist-types/components/shared/primitives/button.d.ts +2 -2
- package/dist-types/components/shared/primitives/button.types.d.ts +1 -1
- package/dist-types/components/shared/streamed-surface.d.ts +23 -0
- package/dist-types/components/shared/surface-styles.d.ts +36 -0
- package/dist-types/components/shared/ui/accordion/accordion.d.ts +2 -2
- package/dist-types/components/shared/ui/accordion/index.d.ts +2 -2
- package/dist-types/components/shared/ui/animated-collapse/index.d.ts +2 -2
- package/dist-types/components/shared/ui/branding.d.ts +1 -1
- package/dist-types/components/shared/ui/button/button.d.ts +1 -1
- package/dist-types/components/shared/ui/button/index.d.ts +2 -2
- package/dist-types/components/shared/ui/collapsible/index.d.ts +1 -1
- package/dist-types/components/shared/ui/dialog/index.d.ts +1 -1
- package/dist-types/components/shared/ui/icon.d.ts +2 -1
- package/dist-types/components/shared/ui/logo.d.ts +0 -10
- package/dist-types/components/shared/ui/preference-item/index.d.ts +1 -1
- package/dist-types/components/shared/ui/preference-item/preference-item.d.ts +13 -0
- package/dist-types/components/shared/ui/switch/index.d.ts +2 -2
- package/dist-types/components/shared/ui/switch/switch.d.ts +1 -1
- package/dist-types/components/shared/ui/tabs/index.d.ts +1 -1
- package/dist-types/consent-gate.d.ts +1 -0
- package/dist-types/consent-theme.d.ts +38 -0
- package/dist-types/context/consent-tracking-context.d.ts +10 -0
- package/dist-types/context/index.d.ts +3 -3
- package/dist-types/context/theme-context.d.ts +3 -3
- package/dist-types/context.d.ts +25 -1
- package/dist-types/devtools-launcher.d.ts +29 -0
- package/dist-types/devtools.d.ts +13 -2
- package/dist-types/draft-context.d.ts +31 -0
- package/dist-types/draft.d.ts +81 -9
- package/dist-types/gpp.d.ts +27 -0
- package/dist-types/headless.d.ts +6 -7
- package/dist-types/hooks/use-committed-ref.d.ts +24 -0
- package/dist-types/hooks/use-focus-trap.d.ts +3 -1
- package/dist-types/hooks/use-headless-iab-consent-ui.d.ts +1 -1
- package/dist-types/hooks/use-iab-manager.d.ts +5 -5
- package/dist-types/hooks/use-iab-policy-guard.d.ts +35 -0
- package/dist-types/hooks/use-late-entry.d.ts +14 -0
- package/dist-types/hooks/use-theme.d.ts +1 -1
- package/dist-types/hooks.d.ts +106 -11
- package/dist-types/iab.d.ts +7 -7
- package/dist-types/index-parts/consent-banner.d.ts +7 -0
- package/dist-types/index-parts/consent-dialog-link.d.ts +7 -0
- package/dist-types/index-parts/consent-dialog-trigger.d.ts +7 -0
- package/dist-types/index-parts/consent-dialog.d.ts +7 -0
- package/dist-types/index-parts/consent-gate.d.ts +7 -0
- package/dist-types/index-parts/core.d.ts +7 -0
- package/dist-types/index-parts/draft.d.ts +7 -0
- package/dist-types/index-parts/frame.d.ts +7 -0
- package/dist-types/index-parts/hooks.d.ts +7 -0
- package/dist-types/index-parts/hosted.d.ts +7 -0
- package/dist-types/index-parts/module-hooks.d.ts +7 -0
- package/dist-types/index-parts/offline.d.ts +7 -0
- package/dist-types/index-parts/presets.d.ts +7 -0
- package/dist-types/index-parts/provider.d.ts +7 -0
- package/dist-types/index-parts/theme.d.ts +8 -0
- package/dist-types/index-parts/translations.d.ts +7 -0
- package/dist-types/index.d.ts +32 -28
- package/dist-types/kernel-selector.d.ts +68 -0
- package/dist-types/modes.d.ts +26 -0
- package/dist-types/module-hooks/iframe-blocker.d.ts +33 -1
- package/dist-types/module-hooks/network-blocker.d.ts +23 -0
- package/dist-types/module-hooks/network-hold.d.ts +47 -0
- package/dist-types/module-hooks.d.ts +4 -4
- package/dist-types/panel-link.d.ts +1 -1
- package/dist-types/panel-trigger.d.ts +1 -1
- package/dist-types/panel.d.ts +13 -1
- package/dist-types/postcss-tailwind3.d.ts +21 -0
- package/dist-types/preferences.d.ts +12 -1
- package/dist-types/primitives/accordion.d.ts +1 -1
- package/dist-types/primitives/button.d.ts +1 -1
- package/dist-types/primitives/collapsible.d.ts +1 -1
- package/dist-types/primitives/dialog.d.ts +1 -1
- package/dist-types/primitives/preference-item.d.ts +1 -1
- package/dist-types/primitives/switch.d.ts +1 -1
- package/dist-types/primitives/tabs.d.ts +1 -1
- package/dist-types/primitives.d.ts +7 -7
- package/dist-types/prompt.d.ts +1 -1
- package/dist-types/provider.d.ts +174 -28
- package/dist-types/server/fetch-ssr-data.d.ts +1 -1
- package/dist-types/server/headers.d.ts +14 -4
- package/dist-types/server/index.d.ts +5 -5
- package/dist-types/server/normalize-url.d.ts +14 -7
- package/dist-types/server/types.d.ts +12 -1
- package/dist-types/theme-provider.d.ts +2 -2
- package/dist-types/transports/hosted.d.ts +36 -0
- package/dist-types/transports/manifest.d.ts +48 -0
- package/dist-types/transports/offline.d.ts +7 -16
- package/dist-types/types/index.d.ts +3 -3
- package/dist-types/types/manager.d.ts +1 -1
- package/dist-types/types/theme/index.d.ts +1 -1
- package/dist-types/ui-config-context.d.ts +14 -2
- package/dist-types/utils/deferred-module.d.ts +13 -0
- package/dist-types/utils/index.d.ts +4 -4
- package/dist-types/utils/merge-slot-props.d.ts +17 -3
- package/dist-types/utils/merge-styles.d.ts +1 -1
- package/dist-types/utils/theme-utils.d.ts +18 -3
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +96 -69
- package/docs/assets/v3/bottom-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/brand-preferences.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/headless-bar-html.png +0 -0
- package/docs/assets/v3/headless-bar-mobile.png +0 -0
- package/docs/assets/v3/headless-bar.png +0 -0
- package/docs/assets/v3/slim-bar.png +0 -0
- package/docs/concepts/choose-your-setup.md +138 -0
- package/docs/concepts/consent-categories.md +84 -0
- package/docs/concepts/consent-state.md +421 -0
- package/docs/concepts/data-fetching.md +270 -0
- package/docs/concepts/how-consent-works.md +123 -0
- package/docs/concepts/modes.md +278 -0
- package/docs/{frameworks/react/concepts/policy-presets.md → concepts/policies.md} +8 -60
- package/docs/customization/class-names.md +202 -0
- package/docs/customization/dark-mode.md +157 -0
- package/docs/customization/motion.md +128 -0
- package/docs/customization/overview.md +68 -33
- package/docs/customization/recipes.md +838 -47
- package/docs/customization/slots.md +217 -35
- package/docs/customization/stylesheets.md +248 -0
- package/docs/customization/tailwind.md +863 -0
- package/docs/customization/tokens.md +167 -36
- package/docs/customization/translations.md +87 -3
- package/docs/frameworks/react/callbacks.md +118 -0
- package/docs/frameworks/react/clear-on-revocation.md +106 -0
- package/docs/frameworks/react/components/consent-banner.md +48 -27
- package/docs/frameworks/react/components/consent-dialog-link.md +13 -11
- package/docs/frameworks/react/components/consent-dialog-trigger.md +86 -76
- package/docs/frameworks/react/components/consent-dialog.md +111 -58
- package/docs/frameworks/react/components/{frame.md → consent-gate.md} +70 -49
- package/docs/frameworks/react/components/consent-provider.md +140 -0
- package/docs/frameworks/react/components/consent-widget.md +69 -24
- package/docs/frameworks/react/components/dev-tools.md +76 -85
- package/docs/frameworks/react/components.md +113 -0
- package/docs/frameworks/react/compose.md +354 -0
- package/docs/frameworks/react/content-security-policy.md +143 -0
- package/docs/frameworks/react/customize.md +258 -0
- package/docs/frameworks/react/embeds.md +89 -0
- package/docs/frameworks/react/gpp.md +163 -0
- package/docs/frameworks/react/headless.md +4 -4
- package/docs/frameworks/react/hooks.md +70 -0
- package/docs/frameworks/react/iab.md +259 -0
- package/docs/frameworks/react/network-blocker.md +140 -0
- package/docs/frameworks/react/quickstart.md +220 -102
- package/docs/frameworks/react/rendering.md +263 -0
- package/docs/frameworks/react/scripts.md +114 -0
- package/docs/frameworks/react/translations.md +155 -0
- package/docs/frameworks/react/troubleshooting.md +188 -61
- package/docs/frameworks/react/upgrade-v3.md +651 -0
- package/docs/frameworks/react/vendor-consent.md +188 -0
- package/docs/guides/banner-experiments.md +672 -0
- package/docs/guides/troubleshooting.md +192 -54
- package/docs/guides/verify-consent.md +96 -49
- package/docs/integrations/adobe-analytics.md +177 -183
- package/docs/integrations/ahrefs-analytics.md +162 -178
- package/docs/integrations/amplitude.md +172 -180
- package/docs/integrations/building-integrations.md +137 -33
- package/docs/integrations/clearbit.md +164 -178
- package/docs/integrations/cloudflare-web-analytics.md +166 -180
- package/docs/integrations/cloudflare-zaraz.md +333 -0
- package/docs/integrations/crisp.md +174 -182
- package/docs/integrations/databuddy.md +167 -197
- package/docs/integrations/fathom-analytics.md +168 -180
- package/docs/integrations/front-chat.md +308 -0
- package/docs/integrations/google-maps.md +142 -108
- package/docs/integrations/google-tag-manager.md +258 -185
- package/docs/integrations/google-tag.md +226 -182
- package/docs/integrations/heap.md +173 -179
- package/docs/integrations/hightouch.md +171 -181
- package/docs/integrations/hotjar.md +169 -179
- package/docs/integrations/intercom.md +193 -177
- package/docs/integrations/klaviyo.md +473 -0
- package/docs/integrations/linkedin-insights.md +184 -174
- package/docs/integrations/logrocket.md +170 -180
- package/docs/integrations/matomo-analytics.md +198 -202
- package/docs/integrations/meta-pixel.md +198 -174
- package/docs/integrations/microsoft-clarity.md +173 -179
- package/docs/integrations/microsoft-uet.md +158 -178
- package/docs/integrations/mixpanel-analytics.md +165 -184
- package/docs/integrations/one-dollar-stats.md +292 -0
- package/docs/integrations/openai-pixel.md +214 -325
- package/docs/integrations/overview.md +152 -83
- package/docs/integrations/pinterest-tag.md +315 -0
- package/docs/integrations/pirsch.md +179 -183
- package/docs/integrations/plausible-analytics.md +182 -182
- package/docs/integrations/posthog.md +323 -264
- package/docs/integrations/promptwatch.md +164 -178
- package/docs/integrations/reddit-pixel.md +195 -181
- package/docs/integrations/rudderstack.md +211 -210
- package/docs/integrations/rybbit-analytics.md +181 -184
- package/docs/integrations/segment.md +192 -178
- package/docs/integrations/sentry.md +402 -0
- package/docs/integrations/snapchat-pixel.md +196 -180
- package/docs/integrations/tiktok-pixel.md +181 -174
- package/docs/integrations/umami-analytics.md +173 -182
- package/docs/integrations/vercel-analytics.md +176 -181
- package/docs/integrations/x-pixel.md +186 -174
- package/docs/integrations/youtube.md +150 -111
- package/package.json +48 -17
- package/dist/component-hooks/use-manager.js +0 -2
- package/dist/components/frame/atoms.js +0 -1
- package/dist/components/frame/frame.js +0 -2
- package/dist/components/frame/index.js +0 -2
- package/dist/frame.js +0 -2
- package/dist/ui-save.js +0 -1
- package/dist-types/component-hooks/use-manager.d.ts +0 -40
- package/dist-types/components/frame/atoms.d.ts +0 -11
- package/dist-types/components/frame/frame.d.ts +0 -2
- package/dist-types/components/frame/index.d.ts +0 -24
- package/dist-types/frame.d.ts +0 -1
- package/dist-types/ui-save.d.ts +0 -5
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/frameworks/react/components/consent-manager-provider.md +0 -62
- package/docs/frameworks/react/concepts/consent-categories.md +0 -33
- package/docs/frameworks/react/hooks/use-consent-manager/overview.md +0 -58
- package/docs/frameworks/react/iab/overview.md +0 -53
- package/docs/frameworks/react/script-loader.md +0 -55
- package/docs/frameworks/react/styling/overview.md +0 -207
- package/docs/guides/consent-state.md +0 -60
- package/docs/guides/data-fetching.md +0 -163
- package/docs/guides/deployment-modes.md +0 -63
- package/docs/upgrade-v3.md +0 -334
- package/readme.json +0 -48
- package/src/iab/styles.css +0 -11
- package/src/styles.css +0 -10
- /package/dist/components/{frame → consent-gate}/types.js +0 -0
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Data fetching and transports
|
|
3
|
-
description: Choose cached manifests, backend init or offline policy resolution,
|
|
4
|
-
and understand where consent records are saved.
|
|
5
|
-
group: guides
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Start with Inth and a cached manifest
|
|
9
|
-
|
|
10
|
-
Use Inth for managed policy and consent records. For a Next.js application with
|
|
11
|
-
a server, use a cached manifest to resolve policy in your application. Route
|
|
12
|
-
browser consent traffic directly to Inth, or optionally use a Next.js rewrite
|
|
13
|
-
to keep those requests on your app's origin. Follow the
|
|
14
|
-
[Next.js manifest setup](https://c15t.com/docs/frameworks/next/data-fetching).
|
|
15
|
-
|
|
16
|
-
Backend ownership and data fetching are separate decisions. Inth manages the
|
|
17
|
-
backend for you. A [self-hosted backend](https://c15t.com/docs/self-host/quickstart) uses the same
|
|
18
|
-
protocol while you operate its database, policies and availability. A static
|
|
19
|
-
site can still call Inth. Only `offline()` deliberately removes consent backend
|
|
20
|
-
requests and stores choices locally.
|
|
21
|
-
|
|
22
|
-
| Fetching path | Where policy resolves | Where choices are submitted | Choose it when |
|
|
23
|
-
| ------------------------------ | ------------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
24
|
-
| Cached manifest on your server | Your application resolves public policy data with each request's location and signals | Inth or your c15t backend | Your host has a runtime server and you want to reuse policy data across requests |
|
|
25
|
-
| Regular backend `/init` | The consent backend | The same backend | You want the fewest moving parts, need backend-owned request resolution, or have no application server |
|
|
26
|
-
| Manifest in the browser | The browser, using supplied or unknown location | Inth or your c15t backend | You deliberately want client resolution and have planned geography, bundle size and policy refresh |
|
|
27
|
-
| Offline | The browser or local runtime, using bundled rules | No backend submission | Local development and tests. Not recommended for production environments. |
|
|
28
|
-
| Custom transport | Your implementation | Your implementation | An existing service cannot use the c15t backend protocol |
|
|
29
|
-
|
|
30
|
-
## What is a consent manifest?
|
|
31
|
-
|
|
32
|
-
A manifest is a versioned policy document served by `GET /manifest`. It contains
|
|
33
|
-
policy rules, translation configuration and related consent configuration. It
|
|
34
|
-
is public configuration, not a visitor's saved choices. A resolver combines the
|
|
35
|
-
manifest with country, region, language and privacy signals to produce an init
|
|
36
|
-
result for one visitor.
|
|
37
|
-
|
|
38
|
-
Reusing the public document avoids asking the consent backend to resolve policy
|
|
39
|
-
for every application request. Cache misses and revalidation still fetch the
|
|
40
|
-
manifest, and consent writes still need the backend. Measure the deployed
|
|
41
|
-
request path before promising a latency improvement.
|
|
42
|
-
|
|
43
|
-
Do not put secrets, visitor identifiers or consent records into a manifest.
|
|
44
|
-
Keep personalized init responses out of shared caches. Changing a policy also
|
|
45
|
-
requires a refresh strategy for cached or build-time manifests.
|
|
46
|
-
|
|
47
|
-
## What does regular `/init` do?
|
|
48
|
-
|
|
49
|
-
`hosted({ url })` uses `${url}/init` for initialization and `${url}/subjects` for
|
|
50
|
-
consent submissions. The name `hosted` describes the transport protocol; the URL
|
|
51
|
-
can belong to Inth or your own c15t backend.
|
|
52
|
-
|
|
53
|
-
```ts title="src/consent-mode.ts"
|
|
54
|
-
import { hosted } from 'c15t';
|
|
55
|
-
|
|
56
|
-
export function createConsentMode(backendURL: string) {
|
|
57
|
-
return hosted({ url: backendURL });
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Pass the factory to your adapter's `mode` option. For request rendering, use the
|
|
62
|
-
adapter's server helper and forward its prepared result to the browser. For
|
|
63
|
-
static output, initialize in the browser with a reachable external URL.
|
|
64
|
-
|
|
65
|
-
A regular backend `/init` request lets the backend resolve the visitor context.
|
|
66
|
-
A same-origin URL named `/api/c15t/init` can instead resolve from a cached
|
|
67
|
-
manifest in your application. The URL name alone does not tell you which path
|
|
68
|
-
runs.
|
|
69
|
-
|
|
70
|
-
## How do transports and proxies differ?
|
|
71
|
-
|
|
72
|
-
A transport implements initialization, saving and optional record operations.
|
|
73
|
-
A proxy changes where HTTP requests travel. It does not change the policy
|
|
74
|
-
resolver or make personalized responses safe to cache.
|
|
75
|
-
|
|
76
|
-
For a same-origin init route that resolves a manifest, the hosted transport can
|
|
77
|
-
separate policy reads and record writes. With a backend rewrite mounted at
|
|
78
|
-
`/api/c15t`, a client mode can use:
|
|
79
|
-
|
|
80
|
-
```ts title="src/consent-mode.ts"
|
|
81
|
-
import { hosted } from 'c15t';
|
|
82
|
-
|
|
83
|
-
export const mode = hosted({
|
|
84
|
-
url: '/api/c15t',
|
|
85
|
-
initURL: '/api/c15t/init',
|
|
86
|
-
assertDecisionInputs: true,
|
|
87
|
-
});
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The route must return the c15t init response contract. `assertDecisionInputs`
|
|
91
|
-
binds saves to the resolved policy when init did not return a signed policy
|
|
92
|
-
snapshot token. The backend can then reject a stale policy decision. Next.js
|
|
93
|
-
sets this option for you when `ConsentRoot` receives a `config` with
|
|
94
|
-
`initURL`.
|
|
95
|
-
|
|
96
|
-
The init route resolves policy; the backend rewrite forwards `/api/c15t/subjects`
|
|
97
|
-
and other record endpoints. Configure both if you choose this optional proxy
|
|
98
|
-
variant. The
|
|
99
|
-
[Next.js rewrite recipe](https://c15t.com/docs/frameworks/next/optimization#keep-browser-consent-requests-on-your-origin)
|
|
100
|
-
shows the configuration. A direct absolute backend URL works
|
|
101
|
-
without a rewrite.
|
|
102
|
-
|
|
103
|
-
This optional optimization keeps c15t requests on the app's origin and avoids a separate browser DNS lookup
|
|
104
|
-
and TLS connection to the consent backend. The app server still connects to
|
|
105
|
-
the upstream backend for manifest refreshes and consent writes. Vendor scripts
|
|
106
|
-
and vendor requests keep their own origins.
|
|
107
|
-
|
|
108
|
-
Set the absolute upstream endpoint through `C15T_BACKEND_URL` in Next.js server
|
|
109
|
-
configuration. The endpoint URL is public connection information, not a secret.
|
|
110
|
-
The browser uses `/api/c15t` without needing the upstream URL. A static export
|
|
111
|
-
cannot serve a Next.js route or rewrite at runtime; use the absolute Inth URL or
|
|
112
|
-
a proxy provided by the static host instead.
|
|
113
|
-
|
|
114
|
-
## When should I use offline mode?
|
|
115
|
-
|
|
116
|
-
Not recommended for production environments. Use Inth or a self-hosted backend
|
|
117
|
-
for production policy and consent records.
|
|
118
|
-
|
|
119
|
-
`offline()` resolves bundled policy rules without an init request and acknowledges
|
|
120
|
-
saves locally. The runtime's persistence module stores the choice in browser
|
|
121
|
-
storage. There is no backend audit history, cross-device record service or IP
|
|
122
|
-
geolocation supplied by this transport.
|
|
123
|
-
|
|
124
|
-
Use your adapter's offline factory so its translations and provider context are
|
|
125
|
-
included. This React and Next.js example replaces the hosted mode in an existing
|
|
126
|
-
client provider:
|
|
127
|
-
|
|
128
|
-
```ts title="src/consent-mode.ts"
|
|
129
|
-
import { offline } from 'c15t/react';
|
|
130
|
-
|
|
131
|
-
export const mode = offline();
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
With no `policyRules`, the current offline transport uses the recommended rule
|
|
135
|
-
pack. Supplying `policyRules` replaces that pack. Unknown country and region are
|
|
136
|
-
real resolution inputs; offline mode does not discover a visitor's location.
|
|
137
|
-
Use [policy rules](https://c15t.com/docs/frameworks/next/concepts/policy-presets) to understand
|
|
138
|
-
matching and defaults, and test the missing-location case.
|
|
139
|
-
|
|
140
|
-
Offline mode is an explicit architecture choice, not an automatic fallback for
|
|
141
|
-
a failed Inth request. If hosted initialization fails before a policy resolves,
|
|
142
|
-
optional permissions remain denied and the stock prompt stays hidden. Observe
|
|
143
|
-
initialization failures instead of silently changing policy sources.
|
|
144
|
-
|
|
145
|
-
## Can I provide my own transport?
|
|
146
|
-
|
|
147
|
-
`custom(transport)` accepts a `KernelTransport` with the v3 `init` and `save`
|
|
148
|
-
contract. It does not accept v2 endpoint handlers such as `setConsent`. Keep
|
|
149
|
-
policy resolution, record acknowledgments and failure behavior consistent with
|
|
150
|
-
the kernel contract. Prefer a built-in transport when your backend supports it.
|
|
151
|
-
|
|
152
|
-
## Verify the selected path
|
|
153
|
-
|
|
154
|
-
Inspect browser and server requests separately. A server manifest fetch will
|
|
155
|
-
not appear in the browser's Network panel. On a warm manifest path, check that
|
|
156
|
-
page requests do not call the backend `/init`, a visitor's choice still reaches
|
|
157
|
-
the backend's `/subjects`, and policy changes become visible after the configured
|
|
158
|
-
refresh. In the recommended Next.js setup, the browser should call only
|
|
159
|
-
`/api/c15t` paths for consent HTTP traffic; inspect server logs to verify their
|
|
160
|
-
upstream destinations.
|
|
161
|
-
|
|
162
|
-
Test different locations, missing location headers, GPC, returning choices and
|
|
163
|
-
backend failure. See [verification](./verify-consent.md).
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Choose a deployment mode
|
|
3
|
-
description: Choose who runs your consent backend, then select manifest, init or
|
|
4
|
-
offline resolution for your deployment.
|
|
5
|
-
group: guides
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Use Inth for managed policy and records
|
|
9
|
-
|
|
10
|
-
Start with [Inth](https://inth.com) unless you need to operate the consent
|
|
11
|
-
service yourself or deliberately need only local browser records. Configure
|
|
12
|
-
policy rules and trusted origins in the project, then use its exact backend
|
|
13
|
-
endpoint in your framework setup.
|
|
14
|
-
|
|
15
|
-
| Backend ownership | Policy source | Record storage | Use when |
|
|
16
|
-
| ------------------------- | ------------------------------------------------------ | ---------------------------------------- | ------------------------------------------------------------------------- |
|
|
17
|
-
| Inth hosted service | Centrally managed policy through a manifest or `/init` | Browser records plus backend submissions | You want managed policy and consent records |
|
|
18
|
-
| Self-hosted c15t | Your backend's manifest or `/init` | Browser records plus your database | You need to operate the service and its infrastructure |
|
|
19
|
-
| Browser-only offline mode | Bundled `policyRules` | Browser persistence | Local development and tests. Not recommended for production environments. |
|
|
20
|
-
|
|
21
|
-
Hosted and self-hosted c15t use the same transport protocol. Switching who runs
|
|
22
|
-
the backend does not require switching from manifests to `/init`.
|
|
23
|
-
|
|
24
|
-
## Choose data fetching separately
|
|
25
|
-
|
|
26
|
-
For Next.js deployments with a runtime server, use the
|
|
27
|
-
[manifest setup](https://c15t.com/docs/frameworks/next/data-fetching). It reuses public policy data
|
|
28
|
-
in your application while consent writes still go to Inth. Regular backend
|
|
29
|
-
`/init` is available when you want backend-owned request resolution or a simpler
|
|
30
|
-
browser setup. See [data fetching and transports](./data-fetching.md) for
|
|
31
|
-
the comparison, including custom transports and offline mode.
|
|
32
|
-
|
|
33
|
-
## Match initialization to your application output
|
|
34
|
-
|
|
35
|
-
| Application output | Initial state | Required setup |
|
|
36
|
-
| ------------------ | ------------------------- | ----------------------------------------------------------- |
|
|
37
|
-
| Request SSR | Prepared for this visitor | Adapter request helper and matching client configuration |
|
|
38
|
-
| Static HTML or SPA | Resolved in the browser | Reachable external URLs or deliberately bundled local rules |
|
|
39
|
-
|
|
40
|
-
Request SSR can include the visitor's prompt in the initial HTML. Pass the
|
|
41
|
-
prepared records and policy resolution through to hydration. Do not convert
|
|
42
|
-
effective permissions into new stored choices.
|
|
43
|
-
|
|
44
|
-
Static HTML is shared across visitors. It cannot contain a choice resolved from
|
|
45
|
-
each visitor's cookies or geography at build time. A static site can still use
|
|
46
|
-
Inth through browser requests. A same-origin `/api/c15t` URL only works if a
|
|
47
|
-
service actually serves it; a Next.js static export does not run API routes.
|
|
48
|
-
|
|
49
|
-
A manifest contains reusable public policy data. A resolved init response and
|
|
50
|
-
personalized consent HTML belong to a request. Do not give them the same shared
|
|
51
|
-
cache treatment.
|
|
52
|
-
|
|
53
|
-
## Handle initialization and storage failures
|
|
54
|
-
|
|
55
|
-
While no policy resolves, optional permissions stay denied and the stock
|
|
56
|
-
consent UI stays hidden. No banner can mean pending or failed initialization.
|
|
57
|
-
It does not mean permission to load analytics. Observe errors before changing
|
|
58
|
-
presentation, and do not silently switch to offline policy after a hosted
|
|
59
|
-
request fails.
|
|
60
|
-
|
|
61
|
-
Browser storage can also be unavailable. A working in-memory interaction does
|
|
62
|
-
not prove the choice survives reload. Use
|
|
63
|
-
[verification](./verify-consent.md) to test the actual deployment.
|
package/docs/upgrade-v3.md
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Upgrade to v3 policies
|
|
3
|
-
description: Migrate policy configuration, consent records, callbacks, and
|
|
4
|
-
custom transports to the v3 policy system.
|
|
5
|
-
group: reference
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Start with a policy rule
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { policyRulePresets } from '@c15t/schema';
|
|
12
|
-
import { offline } from '@c15t/react';
|
|
13
|
-
|
|
14
|
-
const mode = offline({
|
|
15
|
-
policyRules: [policyRulePresets.europeOptIn()],
|
|
16
|
-
});
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Pass `mode` to `ConsentProvider`. For a backend integration, configure
|
|
20
|
-
`policyRules` on the backend and use `hosted({ url })` in the provider. Follow the
|
|
21
|
-
[React quickstart](./frameworks/react/quickstart.md),
|
|
22
|
-
[Next.js quickstart](https://c15t.com/docs/frameworks/next/quickstart), or
|
|
23
|
-
[JavaScript quickstart](https://c15t.com/docs/frameworks/javascript/quickstart) for a complete
|
|
24
|
-
integration.
|
|
25
|
-
|
|
26
|
-
The CLI no longer offers `offline-add-policy-packs`, which generated v2
|
|
27
|
-
configuration. For offline integrations, configure `offline({ policyRules })`
|
|
28
|
-
as shown above.
|
|
29
|
-
|
|
30
|
-
Replace legacy `policyPacks` and nested `consent` configuration with rules:
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
import type { PolicyRule } from '@c15t/schema';
|
|
34
|
-
|
|
35
|
-
const policyRules = [
|
|
36
|
-
{
|
|
37
|
-
id: 'default-opt-in',
|
|
38
|
-
match: { fallback: true },
|
|
39
|
-
model: 'opt-in',
|
|
40
|
-
prompt: 'choice',
|
|
41
|
-
categories: ['measurement', 'marketing'],
|
|
42
|
-
scopeMode: 'strict',
|
|
43
|
-
},
|
|
44
|
-
] satisfies PolicyRule[];
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
`model` controls permission defaults. `prompt` controls whether the visitor must
|
|
48
|
-
make a choice, dismiss a notice, or see no prompt. Opt-in and IAB models require
|
|
49
|
-
`prompt: 'choice'`. Opt-out supports `choice`, `notice`, and `none`. The `none`
|
|
50
|
-
model permits optional categories in scope, allows only `prompt: 'none'`, owes
|
|
51
|
-
no rights, and renders no consent UI. v2's `none` model maps to it directly.
|
|
52
|
-
|
|
53
|
-
When `categories` selects only some optional categories, you must set
|
|
54
|
-
`scopeMode` explicitly. A strict scope blocks categories outside the rule. A permissive scope allows
|
|
55
|
-
those categories unless another restriction applies. An omitted scope, `['*']`,
|
|
56
|
-
or a list containing only `necessary` expands to the default optional categories.
|
|
57
|
-
`necessary` is always permitted.
|
|
58
|
-
|
|
59
|
-
`offline()` without `policyRules` resolves `recommendedPolicyRules()`, whose
|
|
60
|
-
Europe rule also matches a visitor with no country. A known US country with a
|
|
61
|
-
missing state uses US opt-out with GPC and persistent preferences; a missing
|
|
62
|
-
Canadian province stays strict opt-in. The last rule is `none` for other known
|
|
63
|
-
unmatched locations. Resolution exposes `matched`, `no-match`,
|
|
64
|
-
`unconfigured`, or `failed`; while nothing has matched, optional categories stay
|
|
65
|
-
denied and no consent surface renders. A missing or malformed policy never grants
|
|
66
|
-
optional permissions by itself.
|
|
67
|
-
|
|
68
|
-
## Read the state you need
|
|
69
|
-
|
|
70
|
-
| Purpose | Snapshot field | React hook |
|
|
71
|
-
| ----------------------------------------------- | ---------------------- | --------------------------------------- |
|
|
72
|
-
| Gate scripts and optional features | `effectivePermissions` | `useConsent(category)`, `useConsents()` |
|
|
73
|
-
| Inspect recorded choices and confirmation times | `explicitChoice` | `useExplicitChoice()` |
|
|
74
|
-
| Decide whether to prompt | `promptRequirement` | `usePromptRequirement()` |
|
|
75
|
-
| Inspect the resolved rule | `policyRule` | `usePolicyRule()` |
|
|
76
|
-
| Inspect matching or failure | `resolution` | `usePolicyResolution()` |
|
|
77
|
-
|
|
78
|
-
An effective permission is not evidence of a grant. Under an opt-out rule it can
|
|
79
|
-
be true before a visitor acts. A notice dismissal updates `noticeDismissal` and
|
|
80
|
-
does not record consent. Global Privacy Control updates privacy signals and
|
|
81
|
-
configured opt-out directives without turning a browser signal into a choice.
|
|
82
|
-
|
|
83
|
-
## Replace choice callbacks
|
|
84
|
-
|
|
85
|
-
```tsx
|
|
86
|
-
<ConsentProvider
|
|
87
|
-
options={{
|
|
88
|
-
mode,
|
|
89
|
-
callbacks: {
|
|
90
|
-
onChoiceRecorded(event) {
|
|
91
|
-
console.log('Visitor recorded a choice', event);
|
|
92
|
-
},
|
|
93
|
-
onPermissionsChanged(event) {
|
|
94
|
-
console.log('Effective permissions changed', event);
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
{children}
|
|
100
|
-
</ConsentProvider>
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Replace `onConsentSet` with `onChoiceRecorded` for explicit accept, reject, or
|
|
104
|
-
save actions. Use `onPermissionsChanged` for permission changes caused by a
|
|
105
|
-
choice, expiry, policy update, or privacy signal. Provider callbacks no longer
|
|
106
|
-
include `onBannerFetched`; use the resolved policy and pending state to render
|
|
107
|
-
loading UI.
|
|
108
|
-
|
|
109
|
-
Only `kernel.commands.save()` creates an explicit choice. `save('all')` accepts,
|
|
110
|
-
`save('none')` rejects, and `save({ marketing: false })` confirms only marketing.
|
|
111
|
-
A partial save keeps the other categories' confirmation times. Use
|
|
112
|
-
`commands.dismissNotice()` for the notice action and `kernel.hydrate()` to apply
|
|
113
|
-
validated records without recording an action.
|
|
114
|
-
|
|
115
|
-
## Keep existing storage
|
|
116
|
-
|
|
117
|
-
The reader accepts valid v2 storage and translates it into per-category receipts.
|
|
118
|
-
It does not rewrite storage on startup. Existing denials continue to restrict
|
|
119
|
-
permissions; expired or incompatible positive receipts cannot restore grants.
|
|
120
|
-
The next explicit action writes the v3 record. Notice dismissal and privacy
|
|
121
|
-
opt-out directives have separate records.
|
|
122
|
-
|
|
123
|
-
Pass server-prepared `initialRecords`, `initialPolicyResolution`, and `now`
|
|
124
|
-
through the adapter's prefetch configuration. Do not rebuild consent from a
|
|
125
|
-
boolean `hasConsented` or copy effective permissions into explicit choice records.
|
|
126
|
-
Pending prefetch results cannot restore records after a clear or overwrite a
|
|
127
|
-
newer choice.
|
|
128
|
-
|
|
129
|
-
## Update custom transports and backend clients
|
|
130
|
-
|
|
131
|
-
Use `KernelTransport` from `@c15t/core/transports`. Init returns a versioned
|
|
132
|
-
`policyResolution` with a matched rule and fingerprints, or an explicit
|
|
133
|
-
non-matched outcome. Use `mapInitOutputToInitResponse` for an HTTP init payload.
|
|
134
|
-
Do not return legacy `policy` or `policyDecision` fields.
|
|
135
|
-
|
|
136
|
-
Save requests contain the explicit choice and the categories confirmed by this
|
|
137
|
-
action. Return a `SaveResult` with `ok`; optional identity and record methods
|
|
138
|
-
must preserve the same receipt format. Forward the policy contract headers when
|
|
139
|
-
implementing an HTTP proxy. Keep client, schema, backend, and framework adapters
|
|
140
|
-
on compatible v3 versions.
|
|
141
|
-
|
|
142
|
-
Use the supplied hosted or manifest transports to capture policy evidence for
|
|
143
|
-
saves and retries. They preserve the action's policy, location, language, and
|
|
144
|
-
privacy signal inputs. A stale policy assertion is an error; it must not silently
|
|
145
|
-
save under a different rule. See the
|
|
146
|
-
[backend endpoint reference](https://c15t.com/docs/self-host/api/endpoints) for wire fields.
|
|
147
|
-
|
|
148
|
-
## Shared runtime ownership
|
|
149
|
-
|
|
150
|
-
Astro and SvelteKit can create a runtime outside a component tree with
|
|
151
|
-
`createConsentRuntime` from `@c15t/core/runtime`. Pass that runtime to a
|
|
152
|
-
framework provider with its `runtime` prop. The owner calls `start()` after
|
|
153
|
-
mount and `dispose()` when the page no longer needs it. Borrowing providers
|
|
154
|
-
subscribe to the kernel and render UI without initializing or disposing it.
|
|
155
|
-
|
|
156
|
-
Runtime construction preserves the prepared server snapshot. Storage reads,
|
|
157
|
-
privacy-signal activation and script loading begin on `start()`. Pass server
|
|
158
|
-
records through `prefetch.initialRecords` with their evaluation time to keep
|
|
159
|
-
the first browser render consistent with the server. `runtime.clearRecords()`
|
|
160
|
-
clears both persisted and in-memory records.
|
|
161
|
-
|
|
162
|
-
Runtime callbacks use `onChoiceRecorded`, `onPermissionsChanged` and
|
|
163
|
-
`onError`. Hydrating records does not report a new visitor choice.
|
|
164
|
-
|
|
165
|
-
Astro's serializable offline descriptor accepts `policyRules`, just like the
|
|
166
|
-
other adapters' offline factories. Configure a preset or explicit rules;
|
|
167
|
-
omitting them keeps the conservative fallback.
|
|
168
|
-
|
|
169
|
-
## Presentation corrections
|
|
170
|
-
|
|
171
|
-
Use `blocking` for backdrop, scroll locking and focus trapping together.
|
|
172
|
-
Choice banners default to non-blocking, choice walls always block, and notices
|
|
173
|
-
never block. A notice configured as a wall falls back to a floating card.
|
|
174
|
-
Preferences remain centered; `variant` and `position` apply only to prompts.
|
|
175
|
-
|
|
176
|
-
Replace reads of `uncoveredRights` with `preferenceControls`. The latter is a
|
|
177
|
-
list of additional preferences buttons recommended for the stock UI. It does
|
|
178
|
-
not verify disclosure or persistent access to policy rights.
|
|
179
|
-
|
|
180
|
-
Notice acknowledgement uses `common.acknowledge`, falling back to
|
|
181
|
-
`common.dismiss` for older translation bundles. It does not record a choice.
|
|
182
|
-
|
|
183
|
-
## Astro notice acknowledgement
|
|
184
|
-
|
|
185
|
-
```astro
|
|
186
|
-
---
|
|
187
|
-
import ConsentBanner from '@c15t/astro/components/consent-banner.astro';
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
<ConsentBanner dismissButtonText="Got it" />
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Astro's `ConsentBanner` accepts `dismissButtonText` as an optional string. It
|
|
194
|
-
labels the notice acknowledgement button, which defaults to
|
|
195
|
-
`common.acknowledge` and falls back to `common.dismiss` in older translation
|
|
196
|
-
bundles. Acknowledging a notice preserves the visitor's consent choices.
|
|
197
|
-
|
|
198
|
-
## IAB blocking behavior
|
|
199
|
-
|
|
200
|
-
IAB banners and dialogs use the same `presentation.prompt.blocking` and
|
|
201
|
-
`presentation.preferences.blocking` settings as the other consent components.
|
|
202
|
-
A blocking surface shows a backdrop, traps focus and locks page scrolling.
|
|
203
|
-
Explicit `blocking` values take precedence over deprecated `scrollLock` and
|
|
204
|
-
`trapFocus` options. IAB components stay hidden without a matched policy,
|
|
205
|
-
including when a dialog receives `open={true}`.
|
|
206
|
-
|
|
207
|
-
The React consent dialog still blocks pointer interaction with the page when
|
|
208
|
-
`blocking` is true and you hide its backdrop with `overlay={false}`.
|
|
209
|
-
|
|
210
|
-
Legacy prompt options now control the whole blocking behavior. For example,
|
|
211
|
-
`scrollLock: true` alone enables a backdrop and focus trapping as well as
|
|
212
|
-
scroll locking. Set `blocking: false` explicitly for a non-modal banner.
|
|
213
|
-
|
|
214
|
-
Custom dialog backdrops follow the same rule. A dialog resolved as non-blocking
|
|
215
|
-
omits both the default backdrop and a supplied `overlay`. To retain a custom
|
|
216
|
-
backdrop when migrating from `trapFocus: false`, set
|
|
217
|
-
`presentation.preferences.blocking: true` and keep your `overlay` prop.
|
|
218
|
-
|
|
219
|
-
## Next.js and TanStack Start renames
|
|
220
|
-
|
|
221
|
-
These names changed without deprecated aliases. `defineConsentConfig`,
|
|
222
|
-
`ConsentConfig` (the URL config) and `ConsentProvider` from `@c15t/react` are
|
|
223
|
-
unchanged.
|
|
224
|
-
|
|
225
|
-
Next.js (`c15t/next`, `c15t/next/server`, `c15t/next/pages`):
|
|
226
|
-
|
|
227
|
-
| v2 | v3 |
|
|
228
|
-
| --------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
229
|
-
| `ConsentBoundary` | `ConsentRoot` |
|
|
230
|
-
| `ConsentBoundaryProps` | `ConsentRootProps` |
|
|
231
|
-
| `config={initialConsent}` (the visitor's resolved state) | `state={...}` |
|
|
232
|
-
| `consent={consentConfig}` (the `defineConsentConfig` result) | `config={consentConfig}` |
|
|
233
|
-
| `prefetchInitialConsent(options)` | `resolveConsent(options)` with `config` or `backendURL` |
|
|
234
|
-
| `readInitialConsentConfig(options)` | `resolveConsent(options)` without `config` or `backendURL` |
|
|
235
|
-
| `InitialConsentConfig`, and `KernelConfig` where it named the returned value | `ConsentState` |
|
|
236
|
-
| `PrefetchInitialConsentOptions` | `ResolveConsentOptions` |
|
|
237
|
-
| `ReadInitialConsentConfigOptions` | `ConsentRequestOptions` |
|
|
238
|
-
| Pages Router `readInitialConsentConfig(req, opts)` and `prefetchInitialConsent({ req, ... })` | `resolveConsent({ req, ... })` |
|
|
239
|
-
|
|
240
|
-
TanStack Start (`c15t/tanstack-start`, `c15t/tanstack-start/server`):
|
|
241
|
-
|
|
242
|
-
| v2 | v3 |
|
|
243
|
-
| ------------------------------------- | ---------------------------------------------- |
|
|
244
|
-
| `ConsentBoundary` | `ConsentRoot` |
|
|
245
|
-
| `config={config}` | `state={state}` |
|
|
246
|
-
| `ConsentConfig` (the returned state) | `ConsentState` |
|
|
247
|
-
| `prefetchInitialConsent` | `resolveConsent(options)` with `backendURL` |
|
|
248
|
-
| `readInitialConsentConfig` | `resolveConsent(options)` without `backendURL` |
|
|
249
|
-
| `createConsentConfigHandler(options)` | `createConsentStateHandler(options)` |
|
|
250
|
-
| `mergeInitIntoConsentConfig` | `mergeInitIntoConsentState` |
|
|
251
|
-
|
|
252
|
-
`consentLoaderOptions`, `backendURL`, `initRoute` and `DEFAULT_INIT_ROUTE` are
|
|
253
|
-
unchanged.
|
|
254
|
-
|
|
255
|
-
## Next.js RSC banner removal
|
|
256
|
-
|
|
257
|
-
The `@c15t/nextjs/rsc` entry (`c15t/next/rsc`) and its `RscConsentBanner`,
|
|
258
|
-
`RscBannerGate` and `RscBannerActions` exports are gone. Imports of that
|
|
259
|
-
entry now fail to resolve. Use the regular banner for server rendering.
|
|
260
|
-
The retained benchmark results showed slightly faster banner visibility and
|
|
261
|
-
interaction for the experimental shell, so this removal should not be read
|
|
262
|
-
as a performance improvement.
|
|
263
|
-
|
|
264
|
-
Replace `<RscConsentBanner config={config} />` with `<ConsentBanner />` inside
|
|
265
|
-
the same `ConsentRoot`, importing it from `c15t/next` when you use the
|
|
266
|
-
umbrella package or from `@c15t/nextjs` when you depend on the scoped package
|
|
267
|
-
directly. With an awaited `resolveConsent` result, the server renders
|
|
268
|
-
the banner into the response, which is what the RSC variant was for. Move
|
|
269
|
-
`presentation` to `options.presentation` on `ConsentRoot`.
|
|
270
|
-
|
|
271
|
-
Two defaults differ from the removed shell. It rendered no branding link, so
|
|
272
|
-
pass `hideBranding` to keep that. It also styled only its root and action row
|
|
273
|
-
(through the stock `ConsentBanner.Root` and `PolicyActions`) and left the
|
|
274
|
-
card, title, description, footer and buttons without base classes, whereas
|
|
275
|
-
`ConsentBanner` merges the stock styles into every part. If that changes a
|
|
276
|
-
custom layout, do not reach for `noStyle` on the whole banner, which also
|
|
277
|
-
drops the root positioning and action-row layout the old shell kept; compose
|
|
278
|
-
the compound parts instead and pass `noStyle` only to the parts you styled
|
|
279
|
-
yourself.
|
|
280
|
-
|
|
281
|
-
`ConsentBanner` has no `classNames` or `children` props. Move each legacy
|
|
282
|
-
`classNames` key to the `ConsentRoot` `options.components` slots, which take
|
|
283
|
-
`{ className }`:
|
|
284
|
-
|
|
285
|
-
| `classNames` key | Replacement |
|
|
286
|
-
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
287
|
-
| `root`, `card`, `title`, `footer` | `components.banner.root`, `.card`, `.title`, `.footer` |
|
|
288
|
-
| `description` | `components.description.banner` |
|
|
289
|
-
| `rights`, `rightLink` | `components.banner.rights`, `components.banner.rightLink` |
|
|
290
|
-
| `acceptButton`, `rejectButton`, `customizeButton`, `dismissButton` | No per-button slot. Use `components.button.primary` / `.secondary` for shared styles, or target `[data-action="accept"]`, `[data-action="reject"]`, `[data-action="customize"]` and `[data-action="dismiss"]` in CSS. |
|
|
291
|
-
|
|
292
|
-
Custom `children`, and any direct use of `RscBannerGate` or
|
|
293
|
-
`RscBannerActions`, map to the compound parts of `ConsentBanner` in a Client
|
|
294
|
-
Component. `RscBannerGate` becomes `ConsentBanner.Root`, which mounts only
|
|
295
|
-
while the policy owes a prompt and reopens on expiry. Remove the gate
|
|
296
|
-
`prompt` and `model` props; the root derives `data-prompt` and `data-model`
|
|
297
|
-
from the `ConsentRoot` policy. Rename `title` to `aria-label` to preserve its
|
|
298
|
-
accessible label. Keep `children`, `className`, `variant`, `position` and
|
|
299
|
-
`blocking` on the root. Add `disableAnimation` and `trapFocus={false}` to
|
|
300
|
-
retain the old gate defaults.
|
|
301
|
-
|
|
302
|
-
`RscBannerActions`
|
|
303
|
-
becomes `ConsentBanner.PolicyActions`, which renders the rights links and the
|
|
304
|
-
action row the policy requires; `ConsentBanner.Rights`, `RightLink`, `Footer`,
|
|
305
|
-
`FooterSubGroup` and the four buttons are available for finer control.
|
|
306
|
-
`PolicyActions` takes none of the old `acceptLabel`, `rejectLabel`,
|
|
307
|
-
`customizeLabel`, `dismissLabel`, `rightLabels` or `classNames` props: set
|
|
308
|
-
labels through the provider `i18n` translation overrides (`common.acceptAll`,
|
|
309
|
-
`common.rejectAll`, `common.customize`, `common.acknowledge`, `rights.*`), or
|
|
310
|
-
render `ConsentBanner.AcceptButton` and the other buttons with your own
|
|
311
|
-
children; `renderAction` on `PolicyActions` replaces one button; classes move
|
|
312
|
-
to the `components` slots listed in the table. Place the former `children`
|
|
313
|
-
inside `ConsentBanner.Card`:
|
|
314
|
-
|
|
315
|
-
```tsx title="components/banner.tsx"
|
|
316
|
-
'use client';
|
|
317
|
-
|
|
318
|
-
import { ConsentBanner } from 'c15t/next';
|
|
319
|
-
|
|
320
|
-
export function Banner() {
|
|
321
|
-
return (
|
|
322
|
-
<ConsentBanner.Root>
|
|
323
|
-
<ConsentBanner.Card>
|
|
324
|
-
<ConsentBanner.Header>
|
|
325
|
-
<ConsentBanner.Title />
|
|
326
|
-
<ConsentBanner.Description />
|
|
327
|
-
</ConsentBanner.Header>
|
|
328
|
-
<a href="/privacy">Privacy policy</a>
|
|
329
|
-
<ConsentBanner.PolicyActions />
|
|
330
|
-
</ConsentBanner.Card>
|
|
331
|
-
</ConsentBanner.Root>
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
```
|
package/readme.json
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "@c15t/react: React Consent Components",
|
|
3
|
-
"description": "React cookie banner, consent manager, preference center, and headless CMP components for modern React apps.",
|
|
4
|
-
"features": [
|
|
5
|
-
"Works with React 19, 18, 17, and 16.8",
|
|
6
|
-
"Full 'use client' support for React Server Components",
|
|
7
|
-
"Prebuilt and fully customizable cookie banner, consent dialog, and preference center UI",
|
|
8
|
-
"Headless hooks for custom consent flows",
|
|
9
|
-
"Minimal configuration with TypeScript-first design",
|
|
10
|
-
"Comprehensive Consent Management Platform (CMP)",
|
|
11
|
-
"IAB TCF 2.3 UI and hooks through the @c15t/react/iab subpath",
|
|
12
|
-
"Google Tag Manager, Google Consent Mode v2, Meta Pixel, and analytics integrations through @c15t/scripts",
|
|
13
|
-
"Built-in internationalization support",
|
|
14
|
-
"Seamless consent storage and tracking"
|
|
15
|
-
],
|
|
16
|
-
"prerequisites": [
|
|
17
|
-
"React 16.8 or later",
|
|
18
|
-
"Node.js 20.19 or later",
|
|
19
|
-
"A hosted [c15t instance](https://inth.com) (free sign-up), [self-hosted deployment](https://c15t.com/docs/self-host/quickstart), or offline mode for local-only storage"
|
|
20
|
-
],
|
|
21
|
-
"manualInstallation": [
|
|
22
|
-
"",
|
|
23
|
-
"```bash\npnpm add @c15t/react\n```",
|
|
24
|
-
"",
|
|
25
|
-
"Then add the prebuilt stylesheet to your app-level CSS entrypoint:",
|
|
26
|
-
"",
|
|
27
|
-
"```css\n/* src/index.css */\n@import \"@c15t/react/styles.css\";\n```",
|
|
28
|
-
"",
|
|
29
|
-
"If you use the prebuilt IAB TCF UI, also import `@c15t/react/iab/styles.css`. It is published separately so non-IAB apps do not ship those component rules.",
|
|
30
|
-
"",
|
|
31
|
-
"To manually install, follow the guide in our [docs – manual setup](https://c15t.com/docs/frameworks/react/quickstart#manual-setup)."
|
|
32
|
-
],
|
|
33
|
-
"usage": [
|
|
34
|
-
"Import `ConsentManagerProvider` in your app's root component",
|
|
35
|
-
"Add `ConsentBanner` and `ConsentDialog` components",
|
|
36
|
-
"Customize styling and behavior to fit your app",
|
|
37
|
-
"For full implementation details, see the [React quickstart docs](https://c15t.com/docs/frameworks/react/quickstart)",
|
|
38
|
-
|
|
39
|
-
"```tsx\n// App.tsx\nimport {\n ConsentManagerProvider,\n ConsentBanner,\n ConsentDialog,\n} from '@c15t/react'\n\nfunction App() {\n return (\n <ConsentManagerProvider>\n <YourApp />\n <ConsentBanner />\n <ConsentDialog />\n </ConsentManagerProvider>\n )\n}\n```"
|
|
40
|
-
],
|
|
41
|
-
"docsLink": "https://c15t.com/docs/frameworks/react/quickstart",
|
|
42
|
-
"quickStartLink": "https://c15t.com/docs/frameworks/react/quickstart",
|
|
43
|
-
"showCLIGeneration": true,
|
|
44
|
-
"customSections": {
|
|
45
|
-
"Deployment Modes": "- **Hosted on inth.com**: Hosted c15t backend for policy storage, audit history, and hosted infrastructure\n- **Self-hosted backend**: Use @c15t/backend when you need full infrastructure control\n- **Offline mode**: Browser-only consent storage for local development, demos, previews, static sites, or fallback scenarios",
|
|
46
|
-
"Popular Integrations": "- Google Tag Manager with Google Consent Mode v2\n- Google Analytics 4 and Google Ads through gtag.js\n- Meta Pixel, TikTok Pixel, LinkedIn Insights, Microsoft UET, X Pixel, Reddit Pixel, and Snapchat Pixel\n- PostHog, Segment, Mixpanel, Microsoft Clarity, Hotjar, Plausible, Fathom, Matomo, Umami, and Vercel Analytics\n- Intercom and Crisp chat widgets"
|
|
47
|
-
}
|
|
48
|
-
}
|
package/src/iab/styles.css
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @c15t/react — IAB TCF component styles.
|
|
3
|
-
*
|
|
4
|
-
* Add this stylesheet to the same global CSS entrypoint as your base c15t styles
|
|
5
|
-
* when using IAB consent components. Do not import either stylesheet from JS/TSX.
|
|
6
|
-
*
|
|
7
|
-
* Usage (src/index.css):
|
|
8
|
-
* @import "@c15t/react/styles.css";
|
|
9
|
-
* @import "@c15t/react/iab/styles.css";
|
|
10
|
-
*/
|
|
11
|
-
@import '@c15t/ui/iab/styles.css';
|
package/src/styles.css
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @c15t/react — Non-IAB prebuilt component styles.
|
|
3
|
-
*
|
|
4
|
-
* Import this stylesheet once from your app-level CSS entrypoint
|
|
5
|
-
* when using prebuilt (styled) consent components.
|
|
6
|
-
*
|
|
7
|
-
* Usage (src/index.css):
|
|
8
|
-
* @import "@c15t/react/styles.css";
|
|
9
|
-
*/
|
|
10
|
-
@import '@c15t/ui/styles.css';
|
|
File without changes
|