@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.
Files changed (197) hide show
  1. package/AGENTS.md +74 -48
  2. package/README.md +3 -3
  3. package/dist/e2e-test-utils.js +60 -24
  4. package/dist/engine/compile.js +45 -45
  5. package/dist/engine/runtime.js +119 -119
  6. package/dist/registry.js +186 -176
  7. package/dist/resolve.js +12 -12
  8. package/dist/vendors/_shared/attributes.js +5 -5
  9. package/dist/vendors/_shared/google-consent.js +10 -10
  10. package/dist/vendors/_shared/install-builders.js +9 -9
  11. package/dist/vendors/_shared/script-url.js +12 -12
  12. package/dist/vendors/ads-and-pixels/linkedin-insights.js +16 -16
  13. package/dist/vendors/ads-and-pixels/meta-pixel.js +82 -82
  14. package/dist/vendors/ads-and-pixels/microsoft-uet.js +57 -57
  15. package/dist/vendors/ads-and-pixels/openai-pixel.js +88 -0
  16. package/dist/vendors/ads-and-pixels/reddit-pixel.js +39 -39
  17. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +25 -25
  18. package/dist/vendors/ads-and-pixels/tiktok-pixel.js +31 -31
  19. package/dist/vendors/ads-and-pixels/x-pixel.js +17 -17
  20. package/dist/vendors/analytics/adobe-analytics.js +17 -17
  21. package/dist/vendors/analytics/ahrefs-analytics.js +8 -8
  22. package/dist/vendors/analytics/amplitude.js +39 -39
  23. package/dist/vendors/analytics/clearbit.js +11 -11
  24. package/dist/vendors/analytics/cloudflare-web-analytics.js +13 -13
  25. package/dist/vendors/analytics/databuddy.js +45 -45
  26. package/dist/vendors/analytics/fathom-analytics.js +15 -15
  27. package/dist/vendors/analytics/google-tag.js +23 -23
  28. package/dist/vendors/analytics/heap.js +37 -37
  29. package/dist/vendors/analytics/hightouch.js +30 -30
  30. package/dist/vendors/analytics/hotjar.js +14 -14
  31. package/dist/vendors/analytics/logrocket.js +24 -24
  32. package/dist/vendors/analytics/matomo-analytics.js +51 -51
  33. package/dist/vendors/analytics/microsoft-clarity.js +31 -31
  34. package/dist/vendors/analytics/mixpanel-analytics.js +31 -31
  35. package/dist/vendors/analytics/pirsch.js +27 -27
  36. package/dist/vendors/analytics/plausible-analytics.js +24 -24
  37. package/dist/vendors/analytics/posthog.js +84 -79
  38. package/dist/vendors/analytics/promptwatch.js +8 -8
  39. package/dist/vendors/analytics/rudderstack.js +50 -50
  40. package/dist/vendors/analytics/rybbit-analytics.js +30 -30
  41. package/dist/vendors/analytics/segment.js +16 -16
  42. package/dist/vendors/analytics/umami-analytics.js +16 -16
  43. package/dist/vendors/analytics/vercel-analytics.js +22 -22
  44. package/dist/vendors/functional/crisp.js +49 -51
  45. package/dist/vendors/functional/intercom.js +18 -18
  46. package/dist/vendors/tag-managers/google-tag-manager.js +20 -20
  47. package/dist-types/__tests__/helpers.d.ts +10 -10
  48. package/dist-types/engine/compile.d.ts +2 -2
  49. package/dist-types/engine/runtime.d.ts +3 -3
  50. package/dist-types/registry.d.ts +182 -173
  51. package/dist-types/resolve.d.ts +2 -2
  52. package/dist-types/types.d.ts +2 -2
  53. package/dist-types/vendors/_shared/attributes.d.ts +2 -2
  54. package/dist-types/vendors/_shared/google-consent.d.ts +2 -2
  55. package/dist-types/vendors/_shared/install-builders.d.ts +1 -1
  56. package/dist-types/vendors/_shared/script-url.d.ts +6 -6
  57. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +14 -14
  58. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +27 -27
  59. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +40 -40
  60. package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +211 -0
  61. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +28 -29
  62. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +23 -23
  63. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +22 -22
  64. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +15 -15
  65. package/dist-types/vendors/analytics/adobe-analytics.d.ts +3 -3
  66. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +5 -5
  67. package/dist-types/vendors/analytics/amplitude.d.ts +24 -24
  68. package/dist-types/vendors/analytics/clearbit.d.ts +5 -5
  69. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +6 -6
  70. package/dist-types/vendors/analytics/databuddy.d.ts +34 -31
  71. package/dist-types/vendors/analytics/fathom-analytics.d.ts +8 -8
  72. package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
  73. package/dist-types/vendors/analytics/heap.d.ts +17 -17
  74. package/dist-types/vendors/analytics/hightouch.d.ts +15 -15
  75. package/dist-types/vendors/analytics/hotjar.d.ts +9 -9
  76. package/dist-types/vendors/analytics/logrocket.d.ts +11 -11
  77. package/dist-types/vendors/analytics/matomo-analytics.d.ts +3 -3
  78. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +12 -13
  79. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +20 -20
  80. package/dist-types/vendors/analytics/pirsch.d.ts +10 -10
  81. package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
  82. package/dist-types/vendors/analytics/posthog.d.ts +35 -32
  83. package/dist-types/vendors/analytics/promptwatch.d.ts +5 -5
  84. package/dist-types/vendors/analytics/rudderstack.d.ts +16 -16
  85. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +15 -15
  86. package/dist-types/vendors/analytics/segment.d.ts +11 -11
  87. package/dist-types/vendors/analytics/umami-analytics.d.ts +9 -9
  88. package/dist-types/vendors/analytics/vercel-analytics.d.ts +13 -13
  89. package/dist-types/vendors/functional/crisp.d.ts +9 -9
  90. package/dist-types/vendors/functional/intercom.d.ts +12 -12
  91. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +16 -16
  92. package/docs/README.md +74 -48
  93. package/docs/assets/v3/brand-bar.png +0 -0
  94. package/docs/assets/v3/brand-card.png +0 -0
  95. package/docs/assets/v3/choice-wall.png +0 -0
  96. package/docs/assets/v3/mobile-card.png +0 -0
  97. package/docs/assets/v3/preferences.png +0 -0
  98. package/docs/customization/overview.md +45 -0
  99. package/docs/customization/recipes.md +79 -0
  100. package/docs/customization/slots.md +55 -0
  101. package/docs/customization/tokens.md +76 -0
  102. package/docs/customization/translations.md +49 -0
  103. package/docs/frameworks/javascript/script-loader.md +30 -339
  104. package/docs/frameworks/next/script-loader.md +134 -467
  105. package/docs/frameworks/react/script-loader.md +35 -535
  106. package/docs/guides/consent-state.md +60 -0
  107. package/docs/guides/data-fetching.md +163 -0
  108. package/docs/guides/deployment-modes.md +63 -0
  109. package/docs/guides/troubleshooting.md +68 -0
  110. package/docs/guides/verify-consent.md +62 -0
  111. package/docs/integrations/adobe-analytics.md +239 -105
  112. package/docs/integrations/ahrefs-analytics.md +238 -104
  113. package/docs/integrations/amplitude.md +219 -157
  114. package/docs/integrations/building-integrations.md +32 -224
  115. package/docs/integrations/clearbit.md +247 -86
  116. package/docs/integrations/cloudflare-web-analytics.md +250 -84
  117. package/docs/integrations/crisp.md +251 -97
  118. package/docs/integrations/databuddy.md +259 -153
  119. package/docs/integrations/fathom-analytics.md +239 -96
  120. package/docs/integrations/google-maps.md +328 -207
  121. package/docs/integrations/google-tag-manager.md +248 -96
  122. package/docs/integrations/google-tag.md +261 -90
  123. package/docs/integrations/heap.md +222 -149
  124. package/docs/integrations/hightouch.md +225 -131
  125. package/docs/integrations/hotjar.md +239 -90
  126. package/docs/integrations/intercom.md +239 -98
  127. package/docs/integrations/linkedin-insights.md +243 -113
  128. package/docs/integrations/logrocket.md +241 -123
  129. package/docs/integrations/matomo-analytics.md +256 -111
  130. package/docs/integrations/meta-pixel.md +197 -324
  131. package/docs/integrations/microsoft-clarity.md +233 -114
  132. package/docs/integrations/microsoft-uet.md +245 -110
  133. package/docs/integrations/mixpanel-analytics.md +252 -87
  134. package/docs/integrations/openai-pixel.md +441 -0
  135. package/docs/integrations/overview.md +95 -133
  136. package/docs/integrations/pirsch.md +249 -96
  137. package/docs/integrations/plausible-analytics.md +241 -100
  138. package/docs/integrations/posthog.md +353 -214
  139. package/docs/integrations/promptwatch.md +251 -81
  140. package/docs/integrations/reddit-pixel.md +226 -173
  141. package/docs/integrations/rudderstack.md +244 -187
  142. package/docs/integrations/rybbit-analytics.md +244 -91
  143. package/docs/integrations/segment.md +238 -92
  144. package/docs/integrations/snapchat-pixel.md +240 -110
  145. package/docs/integrations/tiktok-pixel.md +249 -81
  146. package/docs/integrations/umami-analytics.md +242 -95
  147. package/docs/integrations/vercel-analytics.md +242 -90
  148. package/docs/integrations/x-pixel.md +238 -104
  149. package/docs/integrations/youtube.md +354 -142
  150. package/docs/upgrade-v3.md +334 -0
  151. package/package.json +85 -78
  152. package/readme.json +2 -2
  153. package/dist/e2e-test-utils.cjs +0 -166
  154. package/dist/engine/compile.cjs +0 -130
  155. package/dist/engine/runtime.cjs +0 -475
  156. package/dist/registry.cjs +0 -423
  157. package/dist/resolve.cjs +0 -71
  158. package/dist/types.cjs +0 -69
  159. package/dist/vendors/_shared/attributes.cjs +0 -55
  160. package/dist/vendors/_shared/google-consent.cjs +0 -69
  161. package/dist/vendors/_shared/install-builders.cjs +0 -59
  162. package/dist/vendors/_shared/script-url.cjs +0 -78
  163. package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +0 -89
  164. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +0 -206
  165. package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +0 -151
  166. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +0 -151
  167. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +0 -131
  168. package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +0 -130
  169. package/dist/vendors/ads-and-pixels/x-pixel.cjs +0 -92
  170. package/dist/vendors/analytics/adobe-analytics.cjs +0 -90
  171. package/dist/vendors/analytics/ahrefs-analytics.cjs +0 -68
  172. package/dist/vendors/analytics/amplitude.cjs +0 -193
  173. package/dist/vendors/analytics/clearbit.cjs +0 -69
  174. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +0 -73
  175. package/dist/vendors/analytics/databuddy.cjs +0 -144
  176. package/dist/vendors/analytics/fathom-analytics.cjs +0 -76
  177. package/dist/vendors/analytics/google-tag.cjs +0 -107
  178. package/dist/vendors/analytics/heap.cjs +0 -181
  179. package/dist/vendors/analytics/hightouch.cjs +0 -153
  180. package/dist/vendors/analytics/hotjar.cjs +0 -85
  181. package/dist/vendors/analytics/logrocket.cjs +0 -99
  182. package/dist/vendors/analytics/matomo-analytics.cjs +0 -232
  183. package/dist/vendors/analytics/microsoft-clarity.cjs +0 -138
  184. package/dist/vendors/analytics/mixpanel-analytics.cjs +0 -134
  185. package/dist/vendors/analytics/pirsch.cjs +0 -108
  186. package/dist/vendors/analytics/plausible-analytics.cjs +0 -122
  187. package/dist/vendors/analytics/posthog.cjs +0 -236
  188. package/dist/vendors/analytics/promptwatch.cjs +0 -70
  189. package/dist/vendors/analytics/rudderstack.cjs +0 -227
  190. package/dist/vendors/analytics/rybbit-analytics.cjs +0 -104
  191. package/dist/vendors/analytics/segment.cjs +0 -97
  192. package/dist/vendors/analytics/umami-analytics.cjs +0 -80
  193. package/dist/vendors/analytics/vercel-analytics.cjs +0 -94
  194. package/dist/vendors/functional/crisp.cjs +0 -143
  195. package/dist/vendors/functional/intercom.cjs +0 -89
  196. package/dist/vendors/tag-managers/google-tag-manager.cjs +0 -100
  197. 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 script integration docs for analytics, advertising pixels, tag managers, widgets, and custom loaders.
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
- Install and configure c15t in JavaScript, React, and Next.js applications.
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
- - [Script Loader](./frameworks/javascript/script-loader.md): Gate third-party scripts behind consent — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
12
- - [Script Loader](./frameworks/next/script-loader.md): Gate third-party scripts behind consent in Next.js — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
13
- - [Script Loader](./frameworks/react/script-loader.md): Gate third-party scripts behind consent in React — load Google Analytics, Meta Pixel, and other tracking scripts only when users grant permission.
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
- Connect analytics, advertising, maps, media, and other third-party tools behind consent.
18
-
19
- - [Adobe Analytics](./integrations/adobe-analytics.md): Adobe Analytics loaded through an Adobe Experience Platform Data Collection Tags embed URL.
20
- - [Ahrefs Analytics](./integrations/ahrefs-analytics.md): Cookieless web analytics from Ahrefs with a prebuilt helper that wires the project key into a c15t-managed script.
21
- - [Amplitude](./integrations/amplitude.md): Load Amplitude Browser SDK 2 with c15t and gate product analytics behind measurement consent.
22
- - [Build a Custom Script Integration](./integrations/building-integrations.md): Learn when to use a raw Script, when to build a reusable manifest-backed integration, and how to debug and test custom consent-aware scripts in c15t.
23
- - [Clearbit](./integrations/clearbit.md): Visitor and company enrichment loaded with Clearbit's account-keyed tags.js snippet.
24
- - [Cloudflare Web Analytics](./integrations/cloudflare-web-analytics.md): Cookieless analytics from Cloudflare with a prebuilt helper that serializes the beacon config into the `data-cf-beacon` attribute.
25
- - [Crisp](./integrations/crisp.md): Load Crisp live chat with website ID, runtime, cookie, and session options.
26
- - [Databuddy](./integrations/databuddy.md): Databuddy is a privacy-focused analytics platform that helps you understand user behavior and track events. It supports cookieless tracking and manages consent automatically through c15t's consent state synchronization.
27
- - [Fathom Analytics](./integrations/fathom-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that maps Fathom's data attributes into a c15t-managed script.
28
- - [Google Maps](./integrations/google-maps.md): Render Google Maps only after consent with one shared Maps JavaScript API loader and independently managed map instances.
29
- - [GA4 + Google Ads (gtag.js)](./integrations/google-tag.md): Send data to Google Analytics 4 and Google Ads with automatic Consent Mode v2 support.
30
- - [Google Tag Manager](./integrations/google-tag-manager.md): Deploy and manage marketing tags centrally with automatic consent state synchronization.
31
- - [Heap](./integrations/heap.md): Load Heap with c15t and gate autocapture product analytics behind measurement consent.
32
- - [Hightouch](./integrations/hightouch.md): Load Hightouch Events with c15t and gate the browser SDK behind measurement consent.
33
- - [Hotjar](./integrations/hotjar.md): Product analytics and behavior insights with a prebuilt helper that seeds Hotjar globals before loading the vendor bundle.
34
- - [Intercom](./integrations/intercom.md): Bootstrap Intercom settings and load the messenger widget bundle.
35
- - [LinkedIn Insights](./integrations/linkedin-insights.md): Track conversions and build matched audiences for LinkedIn advertising campaigns.
36
- - [LogRocket](./integrations/logrocket.md): Session replay and monitoring loaded after measurement consent with LogRocket's browser SDK.
37
- - [Matomo Analytics](./integrations/matomo-analytics.md): Load Matomo with c15t and keep Matomo's queue aligned with measurement consent.
38
- - [Meta Pixel](./integrations/meta-pixel.md): Track conversions and build audiences for Facebook and Instagram advertising campaigns.
39
- - [Microsoft Clarity](./integrations/microsoft-clarity.md): Session replay and behavior analytics with a prebuilt helper that keeps Clarity consent synchronized with c15t measurement state.
40
- - [Microsoft UET](./integrations/microsoft-uet.md): Track conversions and measure performance for Microsoft Advertising and Bing Ads.
41
- - [Mixpanel Analytics](./integrations/mixpanel-analytics.md): Load Mixpanel with c15t and let Mixpanel's own opt-in and opt-out APIs follow measurement consent.
42
- - [Integrations](./integrations/overview.md): Load analytics, pixels, tag managers, and widgets through c15t so consent state controls when they run, update, and appear in your consent UI.
43
- - [Pirsch](./integrations/pirsch.md): Privacy-friendly, cookieless analytics loaded with Pirsch's fixed script id and identification-code attributes.
44
- - [Plausible Analytics](./integrations/plausible-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that preserves Plausible's queue bootstrap and loader attributes.
45
- - [PostHog](./integrations/posthog.md): PostHog is an open-source product analytics platform for tracking user behavior, session replays, feature flags, and A/B testing. It supports cookieless tracking, allowing analytics to continue even without cookie consent.
46
- - [Promptwatch](./integrations/promptwatch.md): Promptwatch analyzes traffic on your site for Artificial Intelligence (AI) traffic and usage insights. Data is stored in the EU without user-identifiable information.
47
- - [Reddit Pixel](./integrations/reddit-pixel.md): Track conversions and build retargeting audiences for Reddit advertising campaigns.
48
- - [RudderStack](./integrations/rudderstack.md): Load RudderStack's JavaScript SDK with c15t and gate the browser SDK behind measurement consent.
49
- - [Rybbit Analytics](./integrations/rybbit-analytics.md): Privacy-friendly analytics with script-tag configuration via Rybbit's data attributes.
50
- - [Segment](./integrations/segment.md): Load Segment Analytics.js with c15t and gate it behind measurement consent.
51
- - [Snapchat Pixel](./integrations/snapchat-pixel.md): Measure Snapchat ad performance and build remarketing audiences with a prebuilt pixel helper.
52
- - [TikTok Pixel](./integrations/tiktok-pixel.md): Measure ad performance and build audiences for TikTok advertising campaigns.
53
- - [Umami Analytics](./integrations/umami-analytics.md): Open-source, cookieless analytics with a prebuilt helper that maps Umami's data attributes into a c15t-managed script.
54
- - [Vercel Analytics](./integrations/vercel-analytics.md): Bootstrap Vercel Analytics with a declarative queue and script attributes.
55
- - [X Pixel (Twitter Pixel)](./integrations/x-pixel.md): Track conversions and build audiences for advertising campaigns on X (formerly Twitter).
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
- Concepts, legal templates, open-source policies, and contributor documentation.
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
+ ![A v3 floating consent card with green Customize action, matching Accept and Reject buttons, and compact corners](../assets/v3/brand-card.png)
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
+ ![The same green theme on a full-width v3 consent bar with the actions arranged across its footer](../assets/v3/brand-bar.png)
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
+ ![A centered v3 choice wall with a backdrop, using the same green action theme](../assets/v3/choice-wall.png)
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
+ ![The v3 preferences dialog with optional category toggles and a green Save Settings action](../assets/v3/preferences.png)
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
+ ![The branded v3 floating card at a 375-pixel viewport, with Accept and Reject sharing a row and Customize below](../assets/v3/mobile-card.png)
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.