@c15t/scripts 2.2.0 → 3.0.0-alpha.0
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 +74 -48
- package/README.md +3 -3
- package/dist/e2e-test-utils.js +60 -24
- package/dist/engine/compile.js +45 -45
- package/dist/engine/runtime.js +119 -119
- package/dist/registry.js +186 -176
- package/dist/resolve.js +12 -12
- package/dist/vendors/_shared/attributes.js +5 -5
- package/dist/vendors/_shared/google-consent.js +10 -10
- package/dist/vendors/_shared/install-builders.js +9 -9
- package/dist/vendors/_shared/script-url.js +12 -12
- package/dist/vendors/ads-and-pixels/linkedin-insights.js +16 -16
- package/dist/vendors/ads-and-pixels/meta-pixel.js +82 -82
- package/dist/vendors/ads-and-pixels/microsoft-uet.js +57 -57
- package/dist/vendors/ads-and-pixels/openai-pixel.js +88 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +39 -39
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +25 -25
- package/dist/vendors/ads-and-pixels/tiktok-pixel.js +31 -31
- package/dist/vendors/ads-and-pixels/x-pixel.js +17 -17
- package/dist/vendors/analytics/adobe-analytics.js +17 -17
- package/dist/vendors/analytics/ahrefs-analytics.js +8 -8
- package/dist/vendors/analytics/amplitude.js +39 -39
- package/dist/vendors/analytics/clearbit.js +11 -11
- package/dist/vendors/analytics/cloudflare-web-analytics.js +13 -13
- package/dist/vendors/analytics/databuddy.js +45 -45
- package/dist/vendors/analytics/fathom-analytics.js +15 -15
- package/dist/vendors/analytics/google-tag.js +23 -23
- package/dist/vendors/analytics/heap.js +37 -37
- package/dist/vendors/analytics/hightouch.js +30 -30
- package/dist/vendors/analytics/hotjar.js +14 -14
- package/dist/vendors/analytics/logrocket.js +24 -24
- package/dist/vendors/analytics/matomo-analytics.js +51 -51
- package/dist/vendors/analytics/microsoft-clarity.js +31 -31
- package/dist/vendors/analytics/mixpanel-analytics.js +31 -31
- package/dist/vendors/analytics/pirsch.js +27 -27
- package/dist/vendors/analytics/plausible-analytics.js +24 -24
- package/dist/vendors/analytics/posthog.js +84 -79
- package/dist/vendors/analytics/promptwatch.js +8 -8
- package/dist/vendors/analytics/rudderstack.js +50 -50
- package/dist/vendors/analytics/rybbit-analytics.js +30 -30
- package/dist/vendors/analytics/segment.js +16 -16
- package/dist/vendors/analytics/umami-analytics.js +16 -16
- package/dist/vendors/analytics/vercel-analytics.js +22 -22
- package/dist/vendors/functional/crisp.js +49 -51
- package/dist/vendors/functional/intercom.js +18 -18
- package/dist/vendors/tag-managers/google-tag-manager.js +20 -20
- package/dist-types/__tests__/helpers.d.ts +10 -10
- package/dist-types/engine/compile.d.ts +2 -2
- package/dist-types/engine/runtime.d.ts +3 -3
- package/dist-types/registry.d.ts +182 -173
- package/dist-types/resolve.d.ts +2 -2
- package/dist-types/types.d.ts +2 -2
- package/dist-types/vendors/_shared/attributes.d.ts +2 -2
- package/dist-types/vendors/_shared/google-consent.d.ts +2 -2
- package/dist-types/vendors/_shared/install-builders.d.ts +1 -1
- package/dist-types/vendors/_shared/script-url.d.ts +6 -6
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +14 -14
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +27 -27
- package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +40 -40
- package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +28 -29
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +23 -23
- package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +22 -22
- package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +15 -15
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +3 -3
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +5 -5
- package/dist-types/vendors/analytics/amplitude.d.ts +24 -24
- package/dist-types/vendors/analytics/clearbit.d.ts +5 -5
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +6 -6
- package/dist-types/vendors/analytics/databuddy.d.ts +34 -31
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +8 -8
- package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
- package/dist-types/vendors/analytics/heap.d.ts +17 -17
- package/dist-types/vendors/analytics/hightouch.d.ts +15 -15
- package/dist-types/vendors/analytics/hotjar.d.ts +9 -9
- package/dist-types/vendors/analytics/logrocket.d.ts +11 -11
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +3 -3
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +12 -13
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +20 -20
- package/dist-types/vendors/analytics/pirsch.d.ts +10 -10
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
- package/dist-types/vendors/analytics/posthog.d.ts +35 -32
- package/dist-types/vendors/analytics/promptwatch.d.ts +5 -5
- package/dist-types/vendors/analytics/rudderstack.d.ts +16 -16
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +15 -15
- package/dist-types/vendors/analytics/segment.d.ts +11 -11
- package/dist-types/vendors/analytics/umami-analytics.d.ts +9 -9
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +13 -13
- package/dist-types/vendors/functional/crisp.d.ts +9 -9
- package/dist-types/vendors/functional/intercom.d.ts +12 -12
- package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +16 -16
- package/docs/README.md +74 -48
- package/docs/assets/v3/brand-bar.png +0 -0
- package/docs/assets/v3/brand-card.png +0 -0
- package/docs/assets/v3/choice-wall.png +0 -0
- package/docs/assets/v3/mobile-card.png +0 -0
- package/docs/assets/v3/preferences.png +0 -0
- package/docs/customization/overview.md +45 -0
- package/docs/customization/recipes.md +79 -0
- package/docs/customization/slots.md +55 -0
- package/docs/customization/tokens.md +76 -0
- package/docs/customization/translations.md +49 -0
- package/docs/frameworks/javascript/script-loader.md +30 -339
- package/docs/frameworks/next/script-loader.md +134 -467
- package/docs/frameworks/react/script-loader.md +35 -535
- package/docs/guides/consent-state.md +60 -0
- package/docs/guides/data-fetching.md +163 -0
- package/docs/guides/deployment-modes.md +63 -0
- package/docs/guides/troubleshooting.md +68 -0
- package/docs/guides/verify-consent.md +62 -0
- package/docs/integrations/adobe-analytics.md +239 -105
- package/docs/integrations/ahrefs-analytics.md +238 -104
- package/docs/integrations/amplitude.md +219 -157
- package/docs/integrations/building-integrations.md +32 -224
- package/docs/integrations/clearbit.md +247 -86
- package/docs/integrations/cloudflare-web-analytics.md +250 -84
- package/docs/integrations/crisp.md +251 -97
- package/docs/integrations/databuddy.md +259 -153
- package/docs/integrations/fathom-analytics.md +239 -96
- package/docs/integrations/google-maps.md +328 -207
- package/docs/integrations/google-tag-manager.md +248 -96
- package/docs/integrations/google-tag.md +261 -90
- package/docs/integrations/heap.md +222 -149
- package/docs/integrations/hightouch.md +225 -131
- package/docs/integrations/hotjar.md +239 -90
- package/docs/integrations/intercom.md +239 -98
- package/docs/integrations/linkedin-insights.md +243 -113
- package/docs/integrations/logrocket.md +241 -123
- package/docs/integrations/matomo-analytics.md +256 -111
- package/docs/integrations/meta-pixel.md +197 -324
- package/docs/integrations/microsoft-clarity.md +233 -114
- package/docs/integrations/microsoft-uet.md +245 -110
- package/docs/integrations/mixpanel-analytics.md +252 -87
- package/docs/integrations/openai-pixel.md +441 -0
- package/docs/integrations/overview.md +95 -133
- package/docs/integrations/pirsch.md +249 -96
- package/docs/integrations/plausible-analytics.md +241 -100
- package/docs/integrations/posthog.md +353 -214
- package/docs/integrations/promptwatch.md +251 -81
- package/docs/integrations/reddit-pixel.md +226 -173
- package/docs/integrations/rudderstack.md +244 -187
- package/docs/integrations/rybbit-analytics.md +244 -91
- package/docs/integrations/segment.md +238 -92
- package/docs/integrations/snapchat-pixel.md +240 -110
- package/docs/integrations/tiktok-pixel.md +249 -81
- package/docs/integrations/umami-analytics.md +242 -95
- package/docs/integrations/vercel-analytics.md +242 -90
- package/docs/integrations/x-pixel.md +238 -104
- package/docs/integrations/youtube.md +354 -142
- package/docs/upgrade-v3.md +334 -0
- package/package.json +85 -78
- package/readme.json +2 -2
- package/dist/e2e-test-utils.cjs +0 -166
- package/dist/engine/compile.cjs +0 -130
- package/dist/engine/runtime.cjs +0 -475
- package/dist/registry.cjs +0 -423
- package/dist/resolve.cjs +0 -71
- package/dist/types.cjs +0 -69
- package/dist/vendors/_shared/attributes.cjs +0 -55
- package/dist/vendors/_shared/google-consent.cjs +0 -69
- package/dist/vendors/_shared/install-builders.cjs +0 -59
- package/dist/vendors/_shared/script-url.cjs +0 -78
- package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +0 -89
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +0 -206
- package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +0 -151
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +0 -151
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +0 -131
- package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +0 -130
- package/dist/vendors/ads-and-pixels/x-pixel.cjs +0 -92
- package/dist/vendors/analytics/adobe-analytics.cjs +0 -90
- package/dist/vendors/analytics/ahrefs-analytics.cjs +0 -68
- package/dist/vendors/analytics/amplitude.cjs +0 -193
- package/dist/vendors/analytics/clearbit.cjs +0 -69
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +0 -73
- package/dist/vendors/analytics/databuddy.cjs +0 -144
- package/dist/vendors/analytics/fathom-analytics.cjs +0 -76
- package/dist/vendors/analytics/google-tag.cjs +0 -107
- package/dist/vendors/analytics/heap.cjs +0 -181
- package/dist/vendors/analytics/hightouch.cjs +0 -153
- package/dist/vendors/analytics/hotjar.cjs +0 -85
- package/dist/vendors/analytics/logrocket.cjs +0 -99
- package/dist/vendors/analytics/matomo-analytics.cjs +0 -232
- package/dist/vendors/analytics/microsoft-clarity.cjs +0 -138
- package/dist/vendors/analytics/mixpanel-analytics.cjs +0 -134
- package/dist/vendors/analytics/pirsch.cjs +0 -108
- package/dist/vendors/analytics/plausible-analytics.cjs +0 -122
- package/dist/vendors/analytics/posthog.cjs +0 -236
- package/dist/vendors/analytics/promptwatch.cjs +0 -70
- package/dist/vendors/analytics/rudderstack.cjs +0 -227
- package/dist/vendors/analytics/rybbit-analytics.cjs +0 -104
- package/dist/vendors/analytics/segment.cjs +0 -97
- package/dist/vendors/analytics/umami-analytics.cjs +0 -80
- package/dist/vendors/analytics/vercel-analytics.cjs +0 -94
- package/dist/vendors/functional/crisp.cjs +0 -143
- package/dist/vendors/functional/intercom.cjs +0 -89
- package/dist/vendors/tag-managers/google-tag-manager.cjs +0 -100
- package/docs/shared/react/guides/script-loader.md +0 -311
package/docs/README.md
CHANGED
|
@@ -1,62 +1,88 @@
|
|
|
1
1
|
# @c15t/scripts
|
|
2
2
|
|
|
3
|
-
> Consent-aware
|
|
3
|
+
> Consent-aware vendor integrations and Consent Mode loading contracts.
|
|
4
4
|
|
|
5
5
|
These docs ship inside the package so coding agents can read them offline. Open the topic file you need from the list below — paths are relative to this file.
|
|
6
6
|
|
|
7
|
+
## Using these docs
|
|
8
|
+
|
|
9
|
+
These docs describe v3. Start with Inth hosted setup, identify the framework, router and deployment, then read its quickstart. Static sites can use Inth directly. Use page Markdown and package-bundled docs for targeted context. Verify scripts, rejection, reload and preferences; banner visibility alone is insufficient.
|
|
10
|
+
|
|
11
|
+
## Start here
|
|
12
|
+
|
|
13
|
+
- [Connect your integrations](./integrations/overview.md)
|
|
14
|
+
- [Customize your consent interface](./customization/overview.md): Choose presentation, theme tokens, slots or custom markup for the change you need.
|
|
15
|
+
- [Verify consent before shipping](./guides/verify-consent.md): Test requests, policy resolution, persistence, navigation and preference changes in a production build.
|
|
16
|
+
- [Upgrade to v3 policies](./upgrade-v3.md): Migrate policy configuration, consent records, callbacks, and custom transports to the v3 policy system.
|
|
17
|
+
|
|
18
|
+
## More documentation
|
|
19
|
+
|
|
20
|
+
[Documentation index](https://c15t.com/docs/llms.txt) · [Full Markdown context](https://c15t.com/llms-full.txt). Prefer the index and individual pages for focused tasks.
|
|
21
|
+
|
|
7
22
|
## Frameworks
|
|
8
23
|
|
|
9
|
-
|
|
24
|
+
- [JavaScript script loading](./frameworks/javascript/script-loader.md): Attach a script loader to the consent kernel and dispose it with the application.
|
|
25
|
+
- [Load scripts with consent](./frameworks/next/script-loader.md): Register vendor scripts in your existing Next.js ConsentRoot and handle loading and revocation.
|
|
26
|
+
- [Load scripts with consent](./frameworks/react/script-loader.md): Register vendor scripts once and let effective permissions control loading.
|
|
27
|
+
|
|
28
|
+
## Guides
|
|
29
|
+
|
|
30
|
+
- [Understand consent state](./guides/consent-state.md): Distinguish policy resolution, effective permissions, explicit choices, notices and privacy signals.
|
|
31
|
+
- [Data fetching and transports](./guides/data-fetching.md): Choose cached manifests, backend init or offline policy resolution, and understand where consent records are saved.
|
|
32
|
+
- [Choose a deployment mode](./guides/deployment-modes.md): Choose who runs your consent backend, then select manifest, init or offline resolution for your deployment.
|
|
33
|
+
- [Troubleshoot consent](./guides/troubleshooting.md): Diagnose missing banners, early vendor requests, lost choices and hydration differences.
|
|
34
|
+
- [Verify consent before shipping](./guides/verify-consent.md): Test requests, policy resolution, persistence, navigation and preference changes in a production build.
|
|
10
35
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- [
|
|
36
|
+
## Customization
|
|
37
|
+
|
|
38
|
+
- [Customize your consent interface](./customization/overview.md): Choose presentation, theme tokens, slots or custom markup for the change you need.
|
|
39
|
+
- [Banner styling recipes](./customization/recipes.md): See real v3 components and reuse the exact theme configuration behind the examples.
|
|
40
|
+
- [Style component slots](./customization/slots.md): Target a specific c15t component part without replacing its markup or behavior.
|
|
41
|
+
- [Theme tokens and CSS](./customization/tokens.md): Style c15t with semantic tokens and use the stylesheet that matches your CSS tooling.
|
|
42
|
+
- [Copy and translations](./customization/translations.md): Change consent wording through i18n and test the complete prompt and preferences flow.
|
|
14
43
|
|
|
15
44
|
## Integrations
|
|
16
45
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [Google
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
45
|
-
- [
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
- [
|
|
54
|
-
- [
|
|
55
|
-
- [
|
|
56
|
-
- [YouTube](./integrations/youtube.md): Keep YouTube iframes unmounted until consent with a privacy-enhanced, lazy-loaded React or Next.js embed.
|
|
46
|
+
- [Adobe Analytics](./integrations/adobe-analytics.md): Configure Adobe Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
47
|
+
- [Ahrefs Analytics](./integrations/ahrefs-analytics.md): Configure Ahrefs Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
48
|
+
- [Amplitude](./integrations/amplitude.md): Configure Amplitude with c15t v3, understand measurement permission and verify loading and revocation.
|
|
49
|
+
- [Custom integrations](./integrations/building-integrations.md): Define loading, initialization and consent-change behavior for a vendor without a helper.
|
|
50
|
+
- [Clearbit](./integrations/clearbit.md): Configure Clearbit with c15t v3, understand marketing permission and verify loading and revocation.
|
|
51
|
+
- [Cloudflare Web Analytics](./integrations/cloudflare-web-analytics.md): Configure Cloudflare Web Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
52
|
+
- [Crisp](./integrations/crisp.md): Configure Crisp with c15t v3, understand functionality permission and verify loading and revocation.
|
|
53
|
+
- [Databuddy](./integrations/databuddy.md): Configure Databuddy's initial and updated consent state with c15t v3.
|
|
54
|
+
- [Fathom Analytics](./integrations/fathom-analytics.md): Configure Fathom Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
55
|
+
- [Google Maps](./integrations/google-maps.md): Prevent a map iframe from mounting before the required permission.
|
|
56
|
+
- [Google Tag](./integrations/google-tag.md): Configure gtag with c15t Consent Mode signals and understand its loading behavior.
|
|
57
|
+
- [Google Tag Manager](./integrations/google-tag-manager.md): Load GTM with c15t consent signals and verify the tags inside your container.
|
|
58
|
+
- [Heap](./integrations/heap.md): Configure Heap with c15t v3, understand measurement permission and verify loading and revocation.
|
|
59
|
+
- [Hightouch](./integrations/hightouch.md): Configure Hightouch with c15t v3, understand measurement permission and verify loading and revocation.
|
|
60
|
+
- [Hotjar](./integrations/hotjar.md): Configure Hotjar with c15t v3, understand measurement permission and verify loading and revocation.
|
|
61
|
+
- [Intercom](./integrations/intercom.md): Load the Intercom messenger with functionality permission and configure its region.
|
|
62
|
+
- [LinkedIn Insight Tag](./integrations/linkedin-insights.md): Configure LinkedIn Insight Tag with c15t v3, understand marketing permission and verify loading and revocation.
|
|
63
|
+
- [LogRocket](./integrations/logrocket.md): Configure LogRocket with c15t v3, understand measurement permission and verify loading and revocation.
|
|
64
|
+
- [Matomo Analytics](./integrations/matomo-analytics.md): Choose gated loading or Matomo consent signaling and configure the correct tracker endpoints.
|
|
65
|
+
- [Meta Pixel](./integrations/meta-pixel.md): Register the Meta Pixel under marketing permission and verify event calls after revocation.
|
|
66
|
+
- [Microsoft Clarity](./integrations/microsoft-clarity.md): Configure Microsoft Clarity with c15t v3, understand measurement permission and verify loading and revocation.
|
|
67
|
+
- [Microsoft UET](./integrations/microsoft-uet.md): Configure Microsoft UET with c15t v3, understand marketing permission and verify loading and revocation.
|
|
68
|
+
- [Mixpanel](./integrations/mixpanel-analytics.md): Configure Mixpanel with c15t v3, understand measurement permission and verify loading and revocation.
|
|
69
|
+
- [OpenAI Pixel](./integrations/openai-pixel.md): Configure the OpenAI Measurement Pixel for ChatGPT Ads with c15t v3, manage marketing permission and verify conversion delivery.
|
|
70
|
+
- [Overview](./integrations/overview.md): Find all c15t integrations for analytics, tag managers, advertising, chat and embedded content.
|
|
71
|
+
- [Pirsch](./integrations/pirsch.md): Configure Pirsch with c15t v3, understand measurement permission and verify loading and revocation.
|
|
72
|
+
- [Plausible Analytics](./integrations/plausible-analytics.md): Configure Plausible Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
73
|
+
- [PostHog](./integrations/posthog.md): Choose PostHog loading and cookieless behavior, configure the region, and synchronize v3 permissions.
|
|
74
|
+
- [Promptwatch](./integrations/promptwatch.md): Configure Promptwatch with c15t v3, understand measurement permission and verify loading and revocation.
|
|
75
|
+
- [Reddit Pixel](./integrations/reddit-pixel.md): Configure Reddit Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
76
|
+
- [RudderStack](./integrations/rudderstack.md): Gate the RudderStack browser SDK or map c15t categories to destination consent IDs.
|
|
77
|
+
- [Rybbit Analytics](./integrations/rybbit-analytics.md): Configure Rybbit Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
78
|
+
- [Segment](./integrations/segment.md): Configure Segment with c15t v3, understand measurement permission and verify loading and revocation.
|
|
79
|
+
- [Snapchat Pixel](./integrations/snapchat-pixel.md): Configure Snapchat Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
80
|
+
- [TikTok Pixel](./integrations/tiktok-pixel.md): Configure TikTok Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
81
|
+
- [Umami Analytics](./integrations/umami-analytics.md): Configure Umami Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
82
|
+
- [Vercel Analytics](./integrations/vercel-analytics.md): Configure Vercel Analytics with c15t v3, understand measurement permission and verify loading and revocation.
|
|
83
|
+
- [X Pixel](./integrations/x-pixel.md): Configure X Pixel with c15t v3, understand marketing permission and verify loading and revocation.
|
|
84
|
+
- [YouTube](./integrations/youtube.md): Gate YouTube embeds with c15t v3 in Next.js, TanStack Start, React, Nuxt, Vue, Astro, Svelte, SvelteKit or JavaScript.
|
|
57
85
|
|
|
58
86
|
## Reference
|
|
59
87
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- [Script Loader](./shared/react/guides/script-loader.md): Reference page for script loader.
|
|
88
|
+
- [Upgrade to v3 policies](./upgrade-v3.md): Migrate policy configuration, consent records, callbacks, and custom transports to the v3 policy system.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Customize your consent interface
|
|
3
|
+
description: Choose presentation, theme tokens, slots or custom markup for the
|
|
4
|
+
change you need.
|
|
5
|
+
group: customization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Start with the change you want
|
|
9
|
+
|
|
10
|
+
| Change | Use | Why |
|
|
11
|
+
| ----------------------------------------- | ----------------------------------- | ------------------------------------------------------------ |
|
|
12
|
+
| Banner shape or location | Presentation or banner props | Keeps policy actions and built-in layout behavior |
|
|
13
|
+
| Brand colors, radius, typography, spacing | Theme tokens | Changes related component parts together |
|
|
14
|
+
| One card, footer, title or button group | Component slots | Targets existing markup |
|
|
15
|
+
| Labels, descriptions or language | i18n configuration | Keeps banner and preferences copy consistent |
|
|
16
|
+
| A different component structure | Compound components where available | Retains the component behavior while changing markup |
|
|
17
|
+
| Your own interaction and markup | Headless APIs | You own rendering, focus behavior and policy action coverage |
|
|
18
|
+
|
|
19
|
+
Most brand changes need tokens and a few slots. Start there before opting out
|
|
20
|
+
of the stock styles. The [recipes](./recipes.md) show how each
|
|
21
|
+
choice affects a real banner.
|
|
22
|
+
|
|
23
|
+
## Keep behavior and appearance separate
|
|
24
|
+
|
|
25
|
+
Presentation controls the prompt's shape, position and blocking behavior.
|
|
26
|
+
Policy controls which actions and rights are required. Changing colors or button
|
|
27
|
+
order does not change a saved choice or policy scope.
|
|
28
|
+
|
|
29
|
+
A choice wall always blocks. Notices never block and cannot become a wall merely
|
|
30
|
+
because `variant: 'wall'` was requested. Preference dialogs remain centered;
|
|
31
|
+
prompt positioning does not move them. Required actions omitted from a custom
|
|
32
|
+
layout can be restored by the policy renderer.
|
|
33
|
+
|
|
34
|
+
## Use the adapter's configuration shape
|
|
35
|
+
|
|
36
|
+
React and Next.js accept provider `theme`, `presentation` and `components`
|
|
37
|
+
options. Vue and Nuxt expose their own shared configuration, including CSS
|
|
38
|
+
`tokens` and component slots. Svelte accepts its provider options and theme
|
|
39
|
+
contract. Astro serializes integration options and uses the selected adapter for
|
|
40
|
+
dialogs. Do not move a configuration object between frameworks without checking
|
|
41
|
+
the target types.
|
|
42
|
+
|
|
43
|
+
Read [tokens and CSS](./tokens.md),
|
|
44
|
+
[slots](./slots.md) or
|
|
45
|
+
[copy and translations](./translations.md) for the next step.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Banner styling recipes
|
|
3
|
+
description: See real v3 components and reuse the exact theme configuration
|
|
4
|
+
behind the examples.
|
|
5
|
+
group: customization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## A branded floating card
|
|
9
|
+
|
|
10
|
+
This theme uses a green primary action and a four-pixel large radius. Accept and
|
|
11
|
+
Reject keep matching treatment. The component's required action behavior stays
|
|
12
|
+
intact.
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { defineTheme } from '@c15t/ui/theme';
|
|
18
|
+
|
|
19
|
+
export const brandTheme = defineTheme({
|
|
20
|
+
colors: { primary: '#2f6f4e' },
|
|
21
|
+
consentActions: {
|
|
22
|
+
primary: { mode: 'filled', variant: 'primary' },
|
|
23
|
+
},
|
|
24
|
+
radius: { lg: '4px' },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Install `@c15t/ui` to use `defineTheme` directly. Pass `brandTheme` as `theme` in
|
|
30
|
+
your existing React or Next.js provider options. Keep your Inth mode and script
|
|
31
|
+
configuration. The theme source above is also imported by the runnable example,
|
|
32
|
+
so the rendered result and the documentation use the same values.
|
|
33
|
+
|
|
34
|
+
## Change the shape without rebuilding the banner
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<ConsentBanner variant="bar" />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
A bar changes the prompt's footprint. It does not change policy, grant categories
|
|
43
|
+
or require a headless implementation.
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
<ConsentBanner variant="wall" />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
A choice wall blocks interaction with the page. A notice never blocks; requesting
|
|
52
|
+
a wall for a notice falls back to a non-blocking presentation.
|
|
53
|
+
|
|
54
|
+
## Carry the theme into preferences
|
|
55
|
+
|
|
56
|
+

|
|
57
|
+
|
|
58
|
+
Keep a preferences link after the banner closes. Test a reject action, reopen
|
|
59
|
+
the dialog, change one category and save. A branded prompt is only part of the
|
|
60
|
+
consent flow.
|
|
61
|
+
|
|
62
|
+
## Check narrow screens
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
This example fits a 375-pixel viewport without horizontal overflow. Test your
|
|
67
|
+
own longest translations and font settings before adopting the same sizing.
|
|
68
|
+
|
|
69
|
+
## Run the examples
|
|
70
|
+
|
|
71
|
+
The source repository contains resettable Storybook examples under
|
|
72
|
+
`Docs / Customization`: Brand Card, Brand Bar and Choice Wall. Each demo uses
|
|
73
|
+
in-memory consent and no analytics; Reset example returns it to a fresh choice.
|
|
74
|
+
The screenshots above come from these v3 examples.
|
|
75
|
+
|
|
76
|
+
The stories are suitable for isolated iframe previews on a version-matched
|
|
77
|
+
Storybook deployment. Keep source code and the explanation on this page when
|
|
78
|
+
embedding them, so the recipe remains usable in Markdown and offline package
|
|
79
|
+
docs. A live preview must use the same v3 revision as the documentation.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Style component slots
|
|
3
|
+
description: Target a specific c15t component part without replacing its markup or behavior.
|
|
4
|
+
group: customization
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Use slots for local changes
|
|
8
|
+
|
|
9
|
+
In React and Next.js, put per-part attributes in `options.components`. This
|
|
10
|
+
fragment belongs in an existing provider's options:
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
components: {
|
|
14
|
+
banner: {
|
|
15
|
+
card: { className: 'rounded-none shadow-none' },
|
|
16
|
+
title: { className: 'font-semibold' },
|
|
17
|
+
footer: { className: 'border-t' },
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The class names above assume Tailwind. A slot can also receive `style` and other
|
|
23
|
+
supported element attributes. Keep shared colors and radius scales in tokens;
|
|
24
|
+
use slots when only one component part should change.
|
|
25
|
+
|
|
26
|
+
## Read attributes on the right element
|
|
27
|
+
|
|
28
|
+
The banner root carries `data-prompt`, `data-model`, `data-variant`,
|
|
29
|
+
`data-position` and `data-blocking`. Its child card does not inherit those HTML
|
|
30
|
+
attributes. In Tailwind, give the root `className: 'group'` and use
|
|
31
|
+
`group-data-[variant=bar]:...` on a child slot.
|
|
32
|
+
|
|
33
|
+
| React banner slot | Use |
|
|
34
|
+
| ---------------------------------- | ------------------------------------- |
|
|
35
|
+
| `root` | Position wrapper and state attributes |
|
|
36
|
+
| `cardShell` | Card sizing and branding container |
|
|
37
|
+
| `card` | Visible card |
|
|
38
|
+
| `header`, `title`, `description` | Heading and explanatory copy |
|
|
39
|
+
| `footer`, `actions`, `actionGroup` | Action layout |
|
|
40
|
+
| `rights`, `rightLink` | Preferences access controls |
|
|
41
|
+
| `overlay` | Backdrop for blocking presentation |
|
|
42
|
+
|
|
43
|
+
Buttons expose `data-action` for action-specific CSS. Test notices as well as
|
|
44
|
+
choice prompts; a notice uses acknowledgement rather than accept/reject.
|
|
45
|
+
|
|
46
|
+
## When to remove styles
|
|
47
|
+
|
|
48
|
+
`noStyle` removes the built-in component styling. It does not supply replacement
|
|
49
|
+
layout, spacing, focus indicators or responsive behavior. Use it when you intend
|
|
50
|
+
to own all of that work, not as the first response to a token that appears to do
|
|
51
|
+
nothing.
|
|
52
|
+
|
|
53
|
+
If the markup itself must change, use the adapter's compound components or
|
|
54
|
+
headless API. The slot objects above are the React contract; check Vue and Svelte
|
|
55
|
+
slot types before reusing them.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Theme tokens and CSS
|
|
3
|
+
description: Style c15t with semantic tokens and use the stylesheet that matches
|
|
4
|
+
your CSS tooling.
|
|
5
|
+
group: customization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Load the stock stylesheet once
|
|
9
|
+
|
|
10
|
+
React, Next.js and Svelte provide `styles.css`. Import the adapter's stylesheet
|
|
11
|
+
at the app's global entry point. Vue includes styles in its components; Astro
|
|
12
|
+
adds styles through its integration.
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import 'c15t/react/styles.css';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The standard stylesheet places rules in `@layer components`. For Tailwind 3,
|
|
19
|
+
use the `styles.tw3.css` entry instead of the standard stylesheet, between the
|
|
20
|
+
components and utilities directives in your Tailwind entry:
|
|
21
|
+
|
|
22
|
+
```css
|
|
23
|
+
@tailwind base;
|
|
24
|
+
@tailwind components;
|
|
25
|
+
@import 'c15t/react/styles.tw3.css';
|
|
26
|
+
@tailwind utilities;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Do not load both c15t stylesheet variants. For Tailwind 4 or unlayered CSS,
|
|
30
|
+
inspect layer order before reaching for `!important`.
|
|
31
|
+
|
|
32
|
+
## Set semantic values together
|
|
33
|
+
|
|
34
|
+
This React theme changes the brand color and large corner radius. Include
|
|
35
|
+
hover and foreground colors when overriding raw variables so the button remains
|
|
36
|
+
readable in each state.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { defineTheme } from '@c15t/ui/theme';
|
|
40
|
+
|
|
41
|
+
export const theme = defineTheme({
|
|
42
|
+
colors: { primary: '#2f6f4e' },
|
|
43
|
+
radius: { lg: '4px' },
|
|
44
|
+
consentActions: {
|
|
45
|
+
primary: { variant: 'primary', mode: 'filled' },
|
|
46
|
+
dismiss: { variant: 'neutral', mode: 'stroke' },
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Install `@c15t/ui` if importing its theme helper directly. Pass `theme` in your
|
|
52
|
+
provider options. `consentActions` selects styling by action role. A per-action
|
|
53
|
+
entry overrides `primary`, which overrides `default`.
|
|
54
|
+
|
|
55
|
+
## Target a prompt with CSS
|
|
56
|
+
|
|
57
|
+
```css
|
|
58
|
+
[data-prompt][data-model='opt-in'] {
|
|
59
|
+
--c15t-primary: #2f6f4e;
|
|
60
|
+
--c15t-primary-hover: #24563c;
|
|
61
|
+
--c15t-text-on-primary: #fff;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use attributes exposed by the rendered component, not guessed class names.
|
|
66
|
+
Test the prompt and the preferences dialog separately because tokens scoped to
|
|
67
|
+
one prompt do not automatically reach a portaled dialog.
|
|
68
|
+
|
|
69
|
+
| Size variable | Default | Target |
|
|
70
|
+
| ----------------------------------- | ------- | ------------- |
|
|
71
|
+
| `--consent-banner-max-width` | `440px` | Floating card |
|
|
72
|
+
| `--consent-banner-widget-max-width` | `20rem` | Widget |
|
|
73
|
+
| `--consent-banner-wall-max-width` | `30rem` | Choice wall |
|
|
74
|
+
|
|
75
|
+
Test long translations and small screens after changing width or typography.
|
|
76
|
+
A compact banner must still fit the required actions.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Copy and translations
|
|
3
|
+
description: Change consent wording through i18n and test the complete prompt
|
|
4
|
+
and preferences flow.
|
|
5
|
+
group: customization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Configure shared messages
|
|
9
|
+
|
|
10
|
+
Use provider `i18n` for wording that should stay consistent across components.
|
|
11
|
+
For React, this fragment belongs in `ConsentProvider` options:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
i18n: {
|
|
15
|
+
messages: {
|
|
16
|
+
en: {
|
|
17
|
+
common: {
|
|
18
|
+
acceptAll: 'Accept all',
|
|
19
|
+
rejectAll: 'Reject optional',
|
|
20
|
+
customize: 'Choose cookies',
|
|
21
|
+
acknowledge: 'Got it',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Supply the same message keys in each supported locale. A one-off component prop
|
|
29
|
+
such as `dismissButtonText` is useful for one banner; use translations for a
|
|
30
|
+
site-wide change. Astro's serializable integration options and Vue's module
|
|
31
|
+
configuration have their own types, so verify those shapes before copying a
|
|
32
|
+
React object.
|
|
33
|
+
|
|
34
|
+
## Write labels that describe the action
|
|
35
|
+
|
|
36
|
+
Accept and Reject record a choice. Customize opens preferences. Acknowledge
|
|
37
|
+
dismisses a notice and does not record a grant. Do not label a notice dismissal
|
|
38
|
+
"Accept all" or make a preferences link sound like it submits an opt-out.
|
|
39
|
+
|
|
40
|
+
The notice acknowledgement uses `common.acknowledge`, with `common.dismiss` as
|
|
41
|
+
a fallback for older translation bundles. Keep the displayed label and the
|
|
42
|
+
command's effect aligned.
|
|
43
|
+
|
|
44
|
+
## Test more than English
|
|
45
|
+
|
|
46
|
+
Try the longest labels you support at a narrow width, with browser zoom and
|
|
47
|
+
right-to-left text where relevant. Check banner actions, category descriptions,
|
|
48
|
+
legal links and the preferences save action. Translate explanations as well as
|
|
49
|
+
buttons so a visitor can make an informed choice.
|