@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
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Data fetching
|
|
3
|
+
description: Choose the recommended build-time policy snapshot or runtime
|
|
4
|
+
manifest fetching, backend /init, browser resolution or offline rules, and
|
|
5
|
+
understand where consent choices are saved.
|
|
6
|
+
group: concepts
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Compare the fetching paths
|
|
10
|
+
|
|
11
|
+
Where policy resolves and where choices are saved are separate from who runs
|
|
12
|
+
the backend. Inth and a [self-hosted backend](https://v3.c15t.com/docs/self-host/quickstart) speak
|
|
13
|
+
the same protocol, so every path below works with either. Only `offline()`
|
|
14
|
+
removes backend requests. For a recommendation by framework, start with
|
|
15
|
+
[choose your setup](./choose-your-setup.md).
|
|
16
|
+
|
|
17
|
+
| Fetching path | Where policy resolves | Where choices are submitted | Choose it when |
|
|
18
|
+
| -------------------------------- | ------------------------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
19
|
+
| Build-time manifest, recommended | Your server or browser resolves a bundled policy snapshot with each visitor's inputs | Inth or your c15t backend | Your framework supports a build integration and policy changes can ship with a rebuild |
|
|
20
|
+
| Cached manifest on your server | Your application resolves public policy data with each request's location and signals | Inth or your c15t backend | Policy changes must reach the app without rebuilding, or builds cannot access the backend |
|
|
21
|
+
| 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 |
|
|
22
|
+
| 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 |
|
|
23
|
+
| Offline | The browser or local runtime, using bundled rules | No backend submission | Local development and tests. Not recommended for production environments. |
|
|
24
|
+
| Custom transport | Your implementation | Your implementation | An existing service cannot use the c15t backend protocol |
|
|
25
|
+
|
|
26
|
+
## What is a consent manifest?
|
|
27
|
+
|
|
28
|
+
A manifest is a versioned policy document served by `GET /manifest`. It contains
|
|
29
|
+
policy rules, translation configuration and related consent configuration. It
|
|
30
|
+
is public configuration, not a visitor's saved choices. A resolver combines the
|
|
31
|
+
manifest with country, region, language and privacy signals to produce an init
|
|
32
|
+
result for one visitor.
|
|
33
|
+
|
|
34
|
+
Reusing the public document avoids asking the consent backend to resolve policy
|
|
35
|
+
for every application request. Cache misses and revalidation still fetch the
|
|
36
|
+
manifest, and consent writes still need the backend. Measure the deployed
|
|
37
|
+
request path before promising a latency improvement.
|
|
38
|
+
|
|
39
|
+
Do not put secrets, visitor identifiers or consent records into a manifest.
|
|
40
|
+
Keep personalized init responses out of shared caches. Changing a policy also
|
|
41
|
+
requires a refresh strategy for cached or build-time manifests.
|
|
42
|
+
|
|
43
|
+
## Use a build-time manifest by default
|
|
44
|
+
|
|
45
|
+
The build fetches your public policy once and bundles it, so the server never
|
|
46
|
+
fetches it at runtime.
|
|
47
|
+
|
|
48
|
+
`manifest()` is the default mode in every server-rendered framework.
|
|
49
|
+
[Consent modes](./modes.md#download-the-manifest-at-build-time)
|
|
50
|
+
covers each framework's build integration and what happens when the
|
|
51
|
+
download fails.
|
|
52
|
+
|
|
53
|
+
The framework quickstarts include the build integration for supported
|
|
54
|
+
deployments. Server resolution uses the snapshot without an upstream manifest
|
|
55
|
+
request. Browser resolution includes the policy and resolver in the client
|
|
56
|
+
bundle, and may still request location for regional policies. Static Nuxt and
|
|
57
|
+
Astro sites and script-tag sites keep the runtime setup from their guides.
|
|
58
|
+
|
|
59
|
+
The snapshot is fixed at build time:
|
|
60
|
+
|
|
61
|
+
* Rebuild after changing policies, translations or vendors. If your CI caches
|
|
62
|
+
build output, force a fresh build.
|
|
63
|
+
* Consent choices still go to the backend.
|
|
64
|
+
|
|
65
|
+
The build reads the backend URL from your public backend URL variable when
|
|
66
|
+
the config doesn't pass one: `NEXT_PUBLIC_C15T_BACKEND_URL` in Next.js,
|
|
67
|
+
`NUXT_PUBLIC_C15T_BACKEND_URL` in Nuxt, `PUBLIC_C15T_BACKEND_URL` in Astro,
|
|
68
|
+
Svelte and SvelteKit, and `VITE_C15T_BACKEND_URL` in TanStack Start and other
|
|
69
|
+
Vite apps. Each also reads the matching Inth variable, such as
|
|
70
|
+
`NEXT_PUBLIC_INTH_PROJECT_URL`, when the c15t one is unset. See
|
|
71
|
+
[set the backend URL](./modes.md#set-the-backend-url).
|
|
72
|
+
|
|
73
|
+
The fetch waits at most 10 seconds. When it fails, or no backend URL is set,
|
|
74
|
+
every framework does the same thing:
|
|
75
|
+
|
|
76
|
+
| Command | Default when the fetch fails |
|
|
77
|
+
| ------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
78
|
+
| Production build: `next build`, `vite build`, `nuxt build`, `astro build` | The build stops with an error. |
|
|
79
|
+
| Dev: `next dev`, `vite dev`, `nuxt dev`, `astro dev` | A warning, and the server fetches the policy at runtime. |
|
|
80
|
+
|
|
81
|
+
Set `onBuildError` to use one behaviour for both. `'fail'` stops dev too.
|
|
82
|
+
`'runtime'` lets a production build finish, and the server fetches the policy
|
|
83
|
+
at runtime. The `C15T_ON_BUILD_ERROR` environment variable overrides the
|
|
84
|
+
option, so you can deploy during a backend outage without a code change:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
C15T_ON_BUILD_ERROR=runtime npm run build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Turborepo's strict environment mode hides undeclared variables from tasks, so
|
|
91
|
+
list `C15T_ON_BUILD_ERROR` in the build task's `passThroughEnv` there.
|
|
92
|
+
|
|
93
|
+
The build skips the fetch, without an error, when it can't use a snapshot,
|
|
94
|
+
for example when the backend URL is relative. With `onBuildError: 'fail'`, a
|
|
95
|
+
relative URL stops the build. [Consent modes](./modes.md#what-happens-when-the-download-fails)
|
|
96
|
+
lists every case.
|
|
97
|
+
|
|
98
|
+
## How manifest mode counts visitors
|
|
99
|
+
|
|
100
|
+
The backend counts visitors from `/init` requests, and manifest resolution
|
|
101
|
+
skips them. To keep the count, the server adapters send a session report after
|
|
102
|
+
each resolution: the host posts to the backend's `POST /sessions` from the
|
|
103
|
+
server, after the response. The browser sends nothing, and the report stores
|
|
104
|
+
no identity; the visitor's IP address and user agent are forwarded under the
|
|
105
|
+
backend's usual IP handling. Static output resolves in the browser and sends
|
|
106
|
+
no report. Set `reportSessions: false` on an adapter to turn it off.
|
|
107
|
+
|
|
108
|
+
## Link an init to the save that follows
|
|
109
|
+
|
|
110
|
+
Each page load gets a journey id, a random UUID sent on requests c15t already
|
|
111
|
+
makes:
|
|
112
|
+
|
|
113
|
+
| Request | Query parameters |
|
|
114
|
+
| ---------------- | ------------------------------------------------------------------------------------ |
|
|
115
|
+
| `GET /init` | `journey`, `journeyScope`, `stored` (`1` if a choice or notice dismissal was stored) |
|
|
116
|
+
| `POST /subjects` | `journey`, `journeyScope` |
|
|
117
|
+
|
|
118
|
+
Session reports carry it as `journey: { id, scope, storedChoice, prompt, domain }`.
|
|
119
|
+
A report and a save with the same `id` belong to one page load. `prompt` is
|
|
120
|
+
`due`, `stored` or `not-required`; a page that falls back to the default opt-in
|
|
121
|
+
banner counts as `due` or `stored`. A stored answer counts as `stored` even if a
|
|
122
|
+
policy change makes c15t ask again.
|
|
123
|
+
|
|
124
|
+
The id is random, is never the subject id and is never written to a cookie.
|
|
125
|
+
Every save that carries one follows an `/init` or report with the same id.
|
|
126
|
+
Saves replayed after going offline carry none.
|
|
127
|
+
|
|
128
|
+
| `journey` | Behavior |
|
|
129
|
+
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
130
|
+
| `'page'` (default) | One id per page load, in memory. |
|
|
131
|
+
| `'tab'` | Kept in `sessionStorage` while a prompt is due, and removed once the visitor chooses or no prompt is due. Only when the browser resolves init; server-rendered pages use `'page'`. |
|
|
132
|
+
| `false` | No journey. |
|
|
133
|
+
|
|
134
|
+
Set it on the runtime or provider. In Next.js use `defineConsentConfig({ journey })`;
|
|
135
|
+
in TanStack Start pass the same value to `resolveConsent` and `ConsentRoot`; with
|
|
136
|
+
the inline prefetch script, pass it to `buildPrefetchScript`. Vue, Svelte, Astro
|
|
137
|
+
and the script tag use `'page'`. A manifest that resolves locally in the
|
|
138
|
+
browser reports no init, so it sends no journey.
|
|
139
|
+
|
|
140
|
+
If you pass a transport `hosted()` a `fetch`, match on the path: URLs now carry a query string.
|
|
141
|
+
|
|
142
|
+
## What does regular `/init` do?
|
|
143
|
+
|
|
144
|
+
`hosted()` uses `${backendURL}/init` for initialization and
|
|
145
|
+
`${backendURL}/subjects` for consent submissions. The name `hosted` describes
|
|
146
|
+
the protocol; the URL can belong to Inth or your own c15t backend.
|
|
147
|
+
|
|
148
|
+
```ts title="c15t.config.ts"
|
|
149
|
+
import { defineConsentConfig, hosted } from 'c15t/next';
|
|
150
|
+
|
|
151
|
+
export default defineConsentConfig({ mode: hosted() });
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Each framework passes the mode in a different place, and server-rendered
|
|
155
|
+
frameworks take the data `hosted()` from their own package.
|
|
156
|
+
[Consent modes](./modes.md#import-the-factories-from-your-framework-package)
|
|
157
|
+
lists where each one goes.
|
|
158
|
+
|
|
159
|
+
A regular backend `/init` request lets the backend resolve the visitor context.
|
|
160
|
+
A same-origin URL named `/api/c15t/init` can instead resolve from a cached
|
|
161
|
+
manifest in your application. The URL name alone does not tell you which path
|
|
162
|
+
runs.
|
|
163
|
+
|
|
164
|
+
## How do transports and proxies differ?
|
|
165
|
+
|
|
166
|
+
A transport implements initialization, saving and optional record operations.
|
|
167
|
+
A proxy changes where HTTP requests travel. It does not change the policy
|
|
168
|
+
resolver or make personalized responses safe to cache.
|
|
169
|
+
|
|
170
|
+
For a same-origin init route that resolves a manifest, the hosted transport can
|
|
171
|
+
separate policy reads and record writes. With a backend rewrite mounted at
|
|
172
|
+
`/api/c15t`, a single-page app can use the transport `hosted()` from
|
|
173
|
+
`c15t`:
|
|
174
|
+
|
|
175
|
+
```ts title="src/consent-mode.ts"
|
|
176
|
+
import { hosted } from 'c15t';
|
|
177
|
+
|
|
178
|
+
export const mode = hosted({
|
|
179
|
+
backendURL: '/api/c15t',
|
|
180
|
+
initURL: '/api/c15t/init',
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The route must return the c15t init response contract. c15t adds its inputs to
|
|
185
|
+
`initURL` as query parameters, replacing any of your own with the same name.
|
|
186
|
+
See [query parameters and CORS](https://v3.c15t.com/docs/self-host/api/endpoints#query-parameters-and-cors)
|
|
187
|
+
for the names. Because `initURL` is set, `assertDecisionInputs` defaults to
|
|
188
|
+
`true`: saves carry the policy decision they were made against when init
|
|
189
|
+
returned no signed policy snapshot token, so the backend can reject a save
|
|
190
|
+
made against a stale policy. Server-rendered frameworks do this for you when
|
|
191
|
+
you set `routePrefix`: the browser re-inits through `${routePrefix}/init`.
|
|
192
|
+
Every framework rejects `routePrefix: '/'` when it sets up, because a
|
|
193
|
+
catch-all consent route at the site root would catch every page.
|
|
194
|
+
|
|
195
|
+
The init route resolves policy; the backend rewrite forwards `/api/c15t/subjects`
|
|
196
|
+
and other record endpoints. Configure both if you choose this optional proxy
|
|
197
|
+
variant. Server-rendered frameworks do both with one option: `proxy: true` in
|
|
198
|
+
Next.js `c15t.config.ts` or TanStack Start's `createConsentStateHandler`,
|
|
199
|
+
with a consent route created with `proxy: true`. The
|
|
200
|
+
[Next.js recipe](https://v3.c15t.com/docs/frameworks/next/optimization#keep-browser-consent-requests-on-your-origin)
|
|
201
|
+
shows the configuration. A direct absolute backend URL works
|
|
202
|
+
without a rewrite.
|
|
203
|
+
|
|
204
|
+
This optional optimization keeps c15t requests on the app's origin and avoids a separate browser DNS lookup
|
|
205
|
+
and TLS connection to the consent backend. The app server still connects to
|
|
206
|
+
the upstream backend for manifest refreshes and consent writes. Vendor scripts
|
|
207
|
+
and vendor requests keep their own origins.
|
|
208
|
+
|
|
209
|
+
The rewrite destination and the init route use the absolute upstream endpoint,
|
|
210
|
+
such as `https://your-project.inth.app`. The browser uses `/api/c15t` without
|
|
211
|
+
needing the upstream URL. A static export cannot serve a Next.js route or
|
|
212
|
+
rewrite at runtime; use the absolute Inth URL or a proxy provided by the static
|
|
213
|
+
host instead.
|
|
214
|
+
|
|
215
|
+
## When should I use offline mode?
|
|
216
|
+
|
|
217
|
+
Not recommended for production environments. Use Inth or a self-hosted backend
|
|
218
|
+
for production policy and consent records.
|
|
219
|
+
|
|
220
|
+
`offline()` resolves bundled policy rules without an init request and acknowledges
|
|
221
|
+
saves locally. The runtime's persistence module stores the choice in browser
|
|
222
|
+
storage. There is no backend audit history, cross-device record service or IP
|
|
223
|
+
geolocation supplied by this transport.
|
|
224
|
+
|
|
225
|
+
Use your framework's `offline()` so its translations and provider context are
|
|
226
|
+
included. In a React app it replaces the mode passed to `ConsentProvider`:
|
|
227
|
+
|
|
228
|
+
```ts title="src/consent-mode.ts"
|
|
229
|
+
import { offline } from 'c15t/react';
|
|
230
|
+
|
|
231
|
+
export const mode = offline();
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
In Next.js, TanStack Start, Nuxt, Astro and SvelteKit, pass the data
|
|
235
|
+
`offline()` from the framework package where the config takes `mode`; see
|
|
236
|
+
[consent modes](./modes.md#import-the-factories-from-your-framework-package).
|
|
237
|
+
|
|
238
|
+
With no `policyRules`, the current offline transport uses the recommended rule
|
|
239
|
+
pack. Supplying `policyRules` replaces that pack. Unknown country and region are
|
|
240
|
+
real resolution inputs; offline mode does not discover a visitor's location.
|
|
241
|
+
Use [policy rules](./policies.md) to understand
|
|
242
|
+
matching and defaults, and test the missing-location case.
|
|
243
|
+
|
|
244
|
+
Offline mode is an explicit architecture choice, not an automatic fallback for
|
|
245
|
+
a failed Inth request. If hosted initialization fails before a policy resolves,
|
|
246
|
+
optional permissions remain denied and the stock prompt stays hidden. Observe
|
|
247
|
+
initialization failures instead of silently changing policy sources.
|
|
248
|
+
|
|
249
|
+
## Can I provide my own transport?
|
|
250
|
+
|
|
251
|
+
`custom(transport)` accepts a `KernelTransport` with the v3 `init` and `save`
|
|
252
|
+
contract. It does not accept v2 endpoint handlers such as `setConsent`. Keep
|
|
253
|
+
policy resolution, record acknowledgments and failure behavior consistent with
|
|
254
|
+
the kernel contract. Prefer a built-in transport when your backend supports it.
|
|
255
|
+
|
|
256
|
+
## Verify the selected path
|
|
257
|
+
|
|
258
|
+
Inspect browser and server requests separately. A server manifest fetch will
|
|
259
|
+
not appear in the browser's Network panel. With a build-time snapshot, start a
|
|
260
|
+
fresh production server and confirm it makes no upstream `/manifest` request.
|
|
261
|
+
After a policy edit, rebuild and confirm the new policy appears. On a runtime
|
|
262
|
+
manifest path, check that
|
|
263
|
+
page requests do not call the backend `/init`, a visitor's choice still reaches
|
|
264
|
+
the backend's `/subjects`, and policy changes become visible after the configured
|
|
265
|
+
refresh. With a same-origin consent proxy, the browser should call only
|
|
266
|
+
`/api/c15t` paths for consent HTTP traffic; inspect server logs to verify their
|
|
267
|
+
upstream destinations.
|
|
268
|
+
|
|
269
|
+
Test different locations, missing location headers, GPC, returning choices and
|
|
270
|
+
backend failure. See [verification](../guides/verify-consent.md).
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: How consent works
|
|
3
|
+
description: What c15t decides on each page load, the difference between a
|
|
4
|
+
permission and a recorded choice, and what happens when a visitor saves.
|
|
5
|
+
group: concepts
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## What c15t decides on each page load
|
|
9
|
+
|
|
10
|
+
On every page load c15t answers one question for each consent category: is
|
|
11
|
+
this allowed right now? To answer it, c15t:
|
|
12
|
+
|
|
13
|
+
1. Selects a **policy** for the visitor, usually by country and region. The
|
|
14
|
+
policy says whether optional categories start denied (opt-in) or allowed
|
|
15
|
+
(opt-out), and whether to show a banner.
|
|
16
|
+
2. Reads the visitor's **stored choice** from a cookie and localStorage, if
|
|
17
|
+
there is one that still matches the policy.
|
|
18
|
+
3. Reads **privacy signals** such as Global Privacy Control (GPC).
|
|
19
|
+
|
|
20
|
+
The result is a set of **permissions**, one per category. Components, script
|
|
21
|
+
loaders, embeds and your own code read those permissions. Nothing optional
|
|
22
|
+
runs until the policy has resolved: while it loads, and if it fails, every
|
|
23
|
+
optional category is denied.
|
|
24
|
+
|
|
25
|
+
A banner is only the interface. It does not stop a script you load with a
|
|
26
|
+
plain `<script>` tag or a vendor SDK you initialize yourself. To gate that code,
|
|
27
|
+
register it with c15t. See [integrations](../integrations/overview.md).
|
|
28
|
+
|
|
29
|
+
## Categories
|
|
30
|
+
|
|
31
|
+
| Category | Use it for |
|
|
32
|
+
| --------------- | -------------------------------------------------- |
|
|
33
|
+
| `necessary` | Code the site cannot work without. Always allowed. |
|
|
34
|
+
| `functionality` | Optional features such as support chat. |
|
|
35
|
+
| `measurement` | Analytics and usage measurement. |
|
|
36
|
+
| `experience` | Personalization. |
|
|
37
|
+
| `marketing` | Advertising, retargeting and pixels. |
|
|
38
|
+
|
|
39
|
+
Assign a category by what the code does, not by what would be convenient.
|
|
40
|
+
Calling analytics `necessary` does not make it necessary.
|
|
41
|
+
[Consent categories](./consent-categories.md) explains which
|
|
42
|
+
categories the preference dialog shows and how policy scope affects them.
|
|
43
|
+
|
|
44
|
+
## Policies
|
|
45
|
+
|
|
46
|
+
A policy has a **model** and a **prompt**:
|
|
47
|
+
|
|
48
|
+
| Model | Optional categories before a choice |
|
|
49
|
+
| --------- | ----------------------------------------------------------------- |
|
|
50
|
+
| `opt-in` | Denied until the visitor allows them. |
|
|
51
|
+
| `opt-out` | Allowed until the visitor refuses them or sends a privacy signal. |
|
|
52
|
+
| `iab` | Controlled by an IAB TCF consent string. |
|
|
53
|
+
| `none` | Allowed, with no prompt. |
|
|
54
|
+
|
|
55
|
+
| Prompt | What the visitor sees |
|
|
56
|
+
| -------- | ------------------------------------------------------------------------------ |
|
|
57
|
+
| `choice` | A banner asking for a decision. |
|
|
58
|
+
| `notice` | A notice they can dismiss. Dismissing records an acknowledgement, not consent. |
|
|
59
|
+
| `none` | Nothing on load. The policy can still require a way to open preferences. |
|
|
60
|
+
|
|
61
|
+
With [Inth](https://inth.com) you manage policies in your project, and the app
|
|
62
|
+
receives them from the backend. Changing a stylesheet or importing a preset in
|
|
63
|
+
the browser does not override a hosted policy.
|
|
64
|
+
[Policies](./policies.md) covers presets, scope, and why a banner may
|
|
65
|
+
not appear.
|
|
66
|
+
|
|
67
|
+
## A permission is not a recorded choice
|
|
68
|
+
|
|
69
|
+
These two values answer different questions, and mixing them up is the most
|
|
70
|
+
common integration bug:
|
|
71
|
+
|
|
72
|
+
* **Permission** (`effectivePermissions`, `useConsent('measurement')`) answers
|
|
73
|
+
"may this run now?" Under an opt-out policy it can be `true` before the
|
|
74
|
+
visitor has done anything.
|
|
75
|
+
* **Recorded choice** (`explicitChoice`) answers "what did the visitor decide?"
|
|
76
|
+
It only changes when the visitor accepts, rejects or saves preferences.
|
|
77
|
+
|
|
78
|
+
| Task | Read |
|
|
79
|
+
| ---------------------------------------------------- | ------------------- |
|
|
80
|
+
| Load a script or render an optional feature | Permission |
|
|
81
|
+
| Show what the visitor chose, or report consent rates | Recorded choice |
|
|
82
|
+
| Decide whether a prompt is needed | `promptRequirement` |
|
|
83
|
+
| Find out why a region behaves differently | `policyRule` |
|
|
84
|
+
| Check that the policy loaded | `resolution.status` |
|
|
85
|
+
|
|
86
|
+
Never turn a permission into a saved choice. Hydrating server state, reading a
|
|
87
|
+
cookie or rendering a component does not count as a visitor action.
|
|
88
|
+
`onChoiceRecorded` fires only for a visitor's action; `onPermissionsChanged`
|
|
89
|
+
also fires when a choice expires or a privacy signal changes.
|
|
90
|
+
|
|
91
|
+
## Notices and privacy signals
|
|
92
|
+
|
|
93
|
+
Dismissing a notice acknowledges it. It grants nothing and leaves earlier
|
|
94
|
+
refusals in place.
|
|
95
|
+
|
|
96
|
+
GPC is a browser setting that asks sites not to sell or share data. c15t reads
|
|
97
|
+
it live on every evaluation and applies the restrictions your policy configures
|
|
98
|
+
for it. It never becomes a stored refusal: when the browser stops sending GPC,
|
|
99
|
+
the restriction ends. The backend also sees the current value.
|
|
100
|
+
|
|
101
|
+
## What happens when a visitor saves
|
|
102
|
+
|
|
103
|
+
When a visitor clicks Accept, Reject or Save, c15t:
|
|
104
|
+
|
|
105
|
+
1. Updates permissions and closes the banner or dialog in the same click.
|
|
106
|
+
Scripts, embeds and network rules follow the new permissions immediately.
|
|
107
|
+
2. Writes the choice to the cookie and localStorage.
|
|
108
|
+
3. Sends the choice to the consent backend. If the request fails, the choice
|
|
109
|
+
stays saved in the browser and the request is retried later.
|
|
110
|
+
4. Reloads the page if the visitor turned off something they had allowed.
|
|
111
|
+
Code that already ran cannot be unloaded, so the reload starts a page with
|
|
112
|
+
only permitted code. Set `reloadOnConsentRevoked: false` to handle revocation
|
|
113
|
+
yourself.
|
|
114
|
+
|
|
115
|
+
The [consent state reference](./consent-state.md) documents the exact
|
|
116
|
+
ordering, retries, server hydration and how open tabs stay in step.
|
|
117
|
+
|
|
118
|
+
## Where consent data comes from
|
|
119
|
+
|
|
120
|
+
A consent backend supplies policies and stores consent records. Use Inth, run
|
|
121
|
+
the [c15t backend](https://v3.c15t.com/docs/self-host/overview) yourself, or keep policies in the
|
|
122
|
+
browser for local development. [Choose your setup](./choose-your-setup.md)
|
|
123
|
+
walks through the options for your framework and hosting.
|