@c15t/nextjs 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 (220) hide show
  1. package/AGENTS.md +102 -142
  2. package/README.md +4 -4
  3. package/dist/api.js +1 -0
  4. package/dist/config.js +1 -0
  5. package/dist/devtools.js +2 -0
  6. package/dist/headers.js +1 -0
  7. package/dist/iab/styles.css +1 -1
  8. package/dist/iab/styles.tw3.css +133 -19
  9. package/dist/index.js +1 -1
  10. package/dist/middleware.js +1 -0
  11. package/dist/node-bridge.js +1 -0
  12. package/dist/pages.js +1 -0
  13. package/dist/proxy.js +1 -0
  14. package/dist/root.js +2 -0
  15. package/dist/server.js +1 -0
  16. package/dist/static.js +1 -0
  17. package/dist/styles.css +1 -1
  18. package/dist/styles.tw3.css +173 -29
  19. package/dist/version.js +1 -1
  20. package/dist-types/api.d.ts +88 -0
  21. package/dist-types/config.d.ts +110 -0
  22. package/dist-types/devtools.d.ts +1 -0
  23. package/dist-types/headers.d.ts +4 -0
  24. package/dist-types/index.d.ts +28 -10
  25. package/dist-types/middleware.d.ts +15 -0
  26. package/dist-types/node-bridge.d.ts +57 -0
  27. package/dist-types/pages.d.ts +88 -0
  28. package/dist-types/proxy.d.ts +34 -0
  29. package/dist-types/root.d.ts +86 -0
  30. package/dist-types/server.d.ts +164 -0
  31. package/dist-types/static.d.ts +42 -0
  32. package/dist-types/types.d.ts +5 -36
  33. package/dist-types/version.d.ts +1 -1
  34. package/docs/README.md +102 -142
  35. package/docs/assets/v3/brand-bar.png +0 -0
  36. package/docs/assets/v3/brand-card.png +0 -0
  37. package/docs/assets/v3/choice-wall.png +0 -0
  38. package/docs/assets/v3/mobile-card.png +0 -0
  39. package/docs/assets/v3/preferences.png +0 -0
  40. package/docs/customization/overview.md +45 -0
  41. package/docs/customization/recipes.md +79 -0
  42. package/docs/customization/slots.md +55 -0
  43. package/docs/customization/tokens.md +76 -0
  44. package/docs/customization/translations.md +49 -0
  45. package/docs/frameworks/next/api-reference/data-fetching.md +416 -0
  46. package/docs/frameworks/next/app-router.md +403 -0
  47. package/docs/frameworks/next/client-side.md +118 -0
  48. package/docs/frameworks/next/components/consent-banner.md +251 -211
  49. package/docs/frameworks/next/components/consent-dialog-link.md +96 -35
  50. package/docs/frameworks/next/components/consent-dialog-trigger.md +74 -149
  51. package/docs/frameworks/next/components/consent-dialog.md +189 -134
  52. package/docs/frameworks/next/components/consent-manager-provider.md +60 -318
  53. package/docs/frameworks/next/components/consent-widget.md +172 -114
  54. package/docs/frameworks/next/components/dev-tools.md +199 -40
  55. package/docs/frameworks/next/components/frame.md +137 -42
  56. package/docs/frameworks/next/concepts/consent-categories.md +24 -89
  57. package/docs/frameworks/next/concepts/policy-presets.md +142 -0
  58. package/docs/frameworks/next/content-security-policy.md +189 -0
  59. package/docs/frameworks/next/data-fetching.md +74 -0
  60. package/docs/frameworks/next/geography-headers.md +251 -0
  61. package/docs/frameworks/next/headless.md +95 -185
  62. package/docs/frameworks/next/hooks/use-consent-manager/overview.md +42 -163
  63. package/docs/frameworks/next/iab/overview.md +37 -107
  64. package/docs/frameworks/next/optimization.md +158 -194
  65. package/docs/frameworks/next/pages-router.md +296 -0
  66. package/docs/frameworks/next/quickstart.md +31 -132
  67. package/docs/frameworks/next/script-loader.md +134 -467
  68. package/docs/frameworks/next/server-side.md +97 -130
  69. package/docs/frameworks/next/static-export.md +164 -0
  70. package/docs/frameworks/next/styling/overview.md +166 -250
  71. package/docs/frameworks/next/troubleshooting.md +134 -144
  72. package/docs/guides/consent-state.md +60 -0
  73. package/docs/guides/data-fetching.md +163 -0
  74. package/docs/guides/deployment-modes.md +63 -0
  75. package/docs/guides/troubleshooting.md +68 -0
  76. package/docs/guides/verify-consent.md +62 -0
  77. package/docs/integrations/adobe-analytics.md +239 -105
  78. package/docs/integrations/ahrefs-analytics.md +238 -104
  79. package/docs/integrations/amplitude.md +219 -157
  80. package/docs/integrations/building-integrations.md +32 -224
  81. package/docs/integrations/clearbit.md +247 -86
  82. package/docs/integrations/cloudflare-web-analytics.md +250 -84
  83. package/docs/integrations/crisp.md +251 -97
  84. package/docs/integrations/databuddy.md +259 -153
  85. package/docs/integrations/fathom-analytics.md +239 -96
  86. package/docs/integrations/google-maps.md +328 -207
  87. package/docs/integrations/google-tag-manager.md +248 -96
  88. package/docs/integrations/google-tag.md +261 -90
  89. package/docs/integrations/heap.md +222 -149
  90. package/docs/integrations/hightouch.md +225 -131
  91. package/docs/integrations/hotjar.md +239 -90
  92. package/docs/integrations/intercom.md +239 -98
  93. package/docs/integrations/linkedin-insights.md +243 -113
  94. package/docs/integrations/logrocket.md +241 -123
  95. package/docs/integrations/matomo-analytics.md +256 -111
  96. package/docs/integrations/meta-pixel.md +197 -324
  97. package/docs/integrations/microsoft-clarity.md +233 -114
  98. package/docs/integrations/microsoft-uet.md +245 -110
  99. package/docs/integrations/mixpanel-analytics.md +252 -87
  100. package/docs/integrations/openai-pixel.md +441 -0
  101. package/docs/integrations/overview.md +95 -133
  102. package/docs/integrations/pirsch.md +249 -96
  103. package/docs/integrations/plausible-analytics.md +241 -100
  104. package/docs/integrations/posthog.md +353 -214
  105. package/docs/integrations/promptwatch.md +251 -81
  106. package/docs/integrations/reddit-pixel.md +226 -173
  107. package/docs/integrations/rudderstack.md +244 -187
  108. package/docs/integrations/rybbit-analytics.md +244 -91
  109. package/docs/integrations/segment.md +238 -92
  110. package/docs/integrations/snapchat-pixel.md +240 -110
  111. package/docs/integrations/tiktok-pixel.md +249 -81
  112. package/docs/integrations/umami-analytics.md +242 -95
  113. package/docs/integrations/vercel-analytics.md +242 -90
  114. package/docs/integrations/x-pixel.md +238 -104
  115. package/docs/integrations/youtube.md +354 -142
  116. package/docs/upgrade-v3.md +334 -0
  117. package/iab/styles.css +1 -1
  118. package/iab/styles.tw3.css +1 -1
  119. package/package.json +106 -65
  120. package/readme.json +3 -3
  121. package/src/iab/styles.css +1 -1
  122. package/src/iab/styles.tw3.css +1 -1
  123. package/src/styles.css +1 -1
  124. package/src/styles.tw3.css +1 -1
  125. package/styles.css +1 -1
  126. package/styles.tw3.css +1 -1
  127. package/client/components/consent-dialog-link.js +0 -3
  128. package/client/components/integrations.js +0 -3
  129. package/dist/components/integrations/index.cjs +0 -1
  130. package/dist/components/integrations/index.js +0 -1
  131. package/dist/headless.cjs +0 -1
  132. package/dist/index.cjs +0 -1
  133. package/dist/libs/browser-initial-data.cjs +0 -1
  134. package/dist/libs/browser-initial-data.js +0 -1
  135. package/dist/libs/initial-data.cjs +0 -1
  136. package/dist/libs/initial-data.js +0 -1
  137. package/dist/types.cjs +0 -1
  138. package/dist/version.cjs +0 -1
  139. package/dist-types/components/integrations/index.d.ts +0 -1
  140. package/dist-types/libs/browser-initial-data.d.ts +0 -9
  141. package/dist-types/libs/initial-data.d.ts +0 -33
  142. package/docs/frameworks/next/building-headless-components.md +0 -379
  143. package/docs/frameworks/next/callbacks.md +0 -186
  144. package/docs/frameworks/next/concepts/client-modes.md +0 -177
  145. package/docs/frameworks/next/concepts/consent-models.md +0 -117
  146. package/docs/frameworks/next/concepts/cookie-management.md +0 -122
  147. package/docs/frameworks/next/concepts/glossary.md +0 -24
  148. package/docs/frameworks/next/concepts/initialization-flow.md +0 -149
  149. package/docs/frameworks/next/concepts/policy-packs.md +0 -230
  150. package/docs/frameworks/next/hooks/use-color-scheme.md +0 -41
  151. package/docs/frameworks/next/hooks/use-consent-manager/checking-consent.md +0 -96
  152. package/docs/frameworks/next/hooks/use-consent-manager/location-info.md +0 -97
  153. package/docs/frameworks/next/hooks/use-consent-manager/setting-consent.md +0 -94
  154. package/docs/frameworks/next/hooks/use-draggable.md +0 -59
  155. package/docs/frameworks/next/hooks/use-focus-trap.md +0 -42
  156. package/docs/frameworks/next/hooks/use-reduced-motion.md +0 -37
  157. package/docs/frameworks/next/hooks/use-ssr-status.md +0 -32
  158. package/docs/frameworks/next/hooks/use-text-direction.md +0 -50
  159. package/docs/frameworks/next/hooks/use-translations.md +0 -55
  160. package/docs/frameworks/next/iab/consent-banner.md +0 -91
  161. package/docs/frameworks/next/iab/consent-dialog.md +0 -129
  162. package/docs/frameworks/next/iab/use-gvl-data.md +0 -21
  163. package/docs/frameworks/next/iframe-blocking.md +0 -106
  164. package/docs/frameworks/next/internationalization.md +0 -207
  165. package/docs/frameworks/next/network-blocker.md +0 -140
  166. package/docs/frameworks/next/policy-packs.md +0 -248
  167. package/docs/frameworks/next/styling/classnames.md +0 -94
  168. package/docs/frameworks/next/styling/color-scheme.md +0 -84
  169. package/docs/frameworks/next/styling/css-variables.md +0 -53
  170. package/docs/frameworks/next/styling/slots.md +0 -94
  171. package/docs/frameworks/next/styling/tailwind.md +0 -137
  172. package/docs/frameworks/next/styling/tokens.md +0 -156
  173. package/docs/shared/concepts/client-modes.md +0 -103
  174. package/docs/shared/concepts/consent-categories.md +0 -41
  175. package/docs/shared/concepts/consent-models.md +0 -72
  176. package/docs/shared/concepts/cookie-management.md +0 -88
  177. package/docs/shared/concepts/glossary.md +0 -24
  178. package/docs/shared/concepts/initialization-flow.md +0 -105
  179. package/docs/shared/concepts/policy-packs.md +0 -225
  180. package/docs/shared/react/components/consent-banner.md +0 -242
  181. package/docs/shared/react/components/consent-dialog-link.md +0 -45
  182. package/docs/shared/react/components/consent-dialog-trigger.md +0 -185
  183. package/docs/shared/react/components/consent-dialog.md +0 -119
  184. package/docs/shared/react/components/consent-manager-provider.md +0 -225
  185. package/docs/shared/react/components/consent-widget.md +0 -121
  186. package/docs/shared/react/components/dev-tools.md +0 -81
  187. package/docs/shared/react/components/frame.md +0 -52
  188. package/docs/shared/react/guides/building-headless-components.md +0 -110
  189. package/docs/shared/react/guides/callbacks.md +0 -89
  190. package/docs/shared/react/guides/headless.md +0 -31
  191. package/docs/shared/react/guides/iframe-blocking.md +0 -65
  192. package/docs/shared/react/guides/internationalization.md +0 -123
  193. package/docs/shared/react/guides/network-blocker.md +0 -72
  194. package/docs/shared/react/guides/optimization.md +0 -44
  195. package/docs/shared/react/guides/policy-packs.md +0 -173
  196. package/docs/shared/react/guides/script-loader.md +0 -311
  197. package/docs/shared/react/hooks/use-color-scheme.md +0 -31
  198. package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +0 -95
  199. package/docs/shared/react/hooks/use-consent-manager/location-info.md +0 -96
  200. package/docs/shared/react/hooks/use-consent-manager/overview.md +0 -74
  201. package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +0 -93
  202. package/docs/shared/react/hooks/use-draggable.md +0 -30
  203. package/docs/shared/react/hooks/use-focus-trap.md +0 -20
  204. package/docs/shared/react/hooks/use-reduced-motion.md +0 -33
  205. package/docs/shared/react/hooks/use-ssr-status.md +0 -16
  206. package/docs/shared/react/hooks/use-text-direction.md +0 -38
  207. package/docs/shared/react/hooks/use-translations.md +0 -15
  208. package/docs/shared/react/iab/consent-banner.md +0 -60
  209. package/docs/shared/react/iab/consent-dialog.md +0 -76
  210. package/docs/shared/react/iab/overview.md +0 -80
  211. package/docs/shared/react/iab/use-gvl-data.md +0 -21
  212. package/docs/shared/react/styling/classnames.md +0 -93
  213. package/docs/shared/react/styling/color-scheme.md +0 -35
  214. package/docs/shared/react/styling/css-variables.md +0 -53
  215. package/docs/shared/react/styling/overview.md +0 -261
  216. package/docs/shared/react/styling/slots.md +0 -93
  217. package/docs/shared/react/styling/stylesheet-entrypoint.md +0 -8
  218. package/docs/shared/react/styling/tailwind.md +0 -88
  219. package/docs/shared/react/styling/tokens.md +0 -155
  220. package/docs/shared/troubleshooting.md +0 -82
package/AGENTS.md CHANGED
@@ -1,155 +1,115 @@
1
1
  # @c15t/nextjs
2
2
 
3
- > Next.js consent management docs for c15t, including App Router setup, consent UI, SSR behavior, script loading, and integrations.
3
+ > Next.js v3 App Router, Pages Router, static export and hydration with Inth.
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
+ - [Next.js quickstart](./docs/frameworks/next/quickstart.md)
14
+ - [App Router setup](./docs/frameworks/next/app-router.md)
15
+ - [Pages Router setup](./docs/frameworks/next/pages-router.md)
16
+ - [Static export setup](./docs/frameworks/next/static-export.md)
17
+ - [Customize your consent interface](./docs/customization/overview.md): Choose presentation, theme tokens, slots or custom markup for the change you need.
18
+ - [Verify consent before shipping](./docs/guides/verify-consent.md): Test requests, policy resolution, persistence, navigation and preference changes in a production build.
19
+ - [Upgrade to v3 policies](./docs/upgrade-v3.md): Migrate policy configuration, consent records, callbacks, and custom transports to the v3 policy system.
20
+
21
+ ## More documentation
22
+
23
+ [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.
24
+
7
25
  ## Frameworks
8
26
 
9
- Install and configure c15t in JavaScript, React, and Next.js applications.
10
-
11
- - [Building Headless Components](./docs/frameworks/next/building-headless-components.md): Build policy-aware custom consent components in Next.js using the headless hooks and policy-pack tooling.
12
- - [Callbacks](./docs/frameworks/next/callbacks.md): React to consent lifecycle events - initialization, consent changes, errors, and revocation reloads.
13
- - [ConsentBanner](./docs/frameworks/next/components/consent-banner.md): A pre-built consent banner that appears when user consent is needed. Supports policy-aware layout, theming, and advanced composition when markup must change.
14
- - [ConsentDialog](./docs/frameworks/next/components/consent-dialog.md): A modal dialog where users can toggle individual consent categories.
15
- - [ConsentDialogLink](./docs/frameworks/next/components/consent-dialog-link.md): An inline trigger for opening the consent dialog from footers, legal pages, and account settings.
16
- - [ConsentDialogTrigger](./docs/frameworks/next/components/consent-dialog-trigger.md): A floating, draggable button that lets users re-open the consent dialog at any time.
17
- - [ConsentManagerProvider](./docs/frameworks/next/components/consent-manager-provider.md): The root provider component that initializes the consent system and makes consent state available to all child components.
18
- - [ConsentWidget](./docs/frameworks/next/components/consent-widget.md): An inline consent management widget for embedding in settings or privacy pages. Shows category toggles with accordion layout.
19
- - [DevTools](./docs/frameworks/next/components/dev-tools.md): A development tool for inspecting consent state, geolocation, loaded scripts, and consent events in real time.
20
- - [Frame](./docs/frameworks/next/components/frame.md): A consent-gated content wrapper - children only mount when the required consent category is granted.
21
- - [Client Modes](./docs/frameworks/next/concepts/client-modes.md): Choose how c15t connects to its backend - full hosted integration, offline-only, or bring your own backend.
22
- - [Consent Categories](./docs/frameworks/next/concepts/consent-categories.md): How c15t organizes tracking technologies into five consent categories.
23
- - [Consent Models](./docs/frameworks/next/concepts/consent-models.md): How c15t determines consent behavior based on legal jurisdiction.
24
- - [Cookie Management](./docs/frameworks/next/concepts/cookie-management.md): How c15t manages cookies through script, iframe, and network gating
25
- - [Glossary](./docs/frameworks/next/concepts/glossary.md): Key terms used throughout the c15t documentation.
26
- - [Initialization Flow](./docs/frameworks/next/concepts/initialization-flow.md): What happens from provider mount to first render — the full consent lifecycle.
27
- - [Policy Packs](./docs/frameworks/next/concepts/policy-packs.md): How c15t resolves regional consent policies and what a policy pack controls.
28
- - [Headless Mode](./docs/frameworks/next/headless.md): Build fully custom consent UI using only hooks - no pre-built components required.
29
- - [useColorScheme](./docs/frameworks/next/hooks/use-color-scheme.md): Manage light/dark mode preferences for consent components.
30
- - [Checking Consent](./docs/frameworks/next/hooks/use-consent-manager/checking-consent.md): Use has() for flexible consent checks with AND, OR, and NOT logic. Check if any consent exists with hasConsented().
31
- - [Location Info](./docs/frameworks/next/hooks/use-consent-manager/location-info.md): Access detected jurisdiction, country, and region. Override geolocation for testing.
32
- - [useConsentManager](./docs/frameworks/next/hooks/use-consent-manager/overview.md): The primary hook for accessing consent state and actions. Returns the full consent store including all state properties and action methods.
33
- - [Setting Consent](./docs/frameworks/next/hooks/use-consent-manager/setting-consent.md): Save, update, and reset consent preferences with setConsent(), setSelectedConsent(), and saveConsents().
34
- - [useDraggable](./docs/frameworks/next/hooks/use-draggable.md): Make an element draggable between viewport corners with snapping, persistence, and animation support.
35
- - [useFocusTrap](./docs/frameworks/next/hooks/use-focus-trap.md): Trap keyboard focus within a container for accessible modal dialogs.
36
- - [useReducedMotion](./docs/frameworks/next/hooks/use-reduced-motion.md): Detect the user's prefers-reduced-motion OS setting and reactively disable animations.
37
- - [useSSRStatus](./docs/frameworks/next/hooks/use-ssr-status.md): Check whether server-side rendered consent data was used during initialization.
38
- - [useTextDirection](./docs/frameworks/next/hooks/use-text-direction.md): Manage RTL/LTR text direction based on the active language for consent UI.
39
- - [useTranslations](./docs/frameworks/next/hooks/use-translations.md): Access the current language's translations for building custom consent UI.
40
- - [IABConsentBanner](./docs/frameworks/next/iab/consent-banner.md): An IAB TCF 2.3 compliant consent banner that displays partner count, purpose summaries, and legitimate interest notices.
41
- - [IABConsentDialog](./docs/frameworks/next/iab/consent-dialog.md): An IAB TCF 2.3 compliant preference center with tabbed purpose and vendor management.
42
- - [IAB TCF 2.3](./docs/frameworks/next/iab/overview.md): Implement IAB Transparency & Consent Framework 2.3 compliance for programmatic advertising in EU/EEA jurisdictions.
43
- - [useGVLData (Internal)](./docs/frameworks/next/iab/use-gvl-data.md): Status note for the internal GVL hook used by the built-in IAB dialog.
44
- - [Iframe Blocking](./docs/frameworks/next/iframe-blocking.md): Block embedded content (YouTube, social widgets, maps) until users grant consent for the appropriate category.
45
- - [Internationalization](./docs/frameworks/next/internationalization.md): Translate consent UI into 30+ languages with built-in translations, custom overrides, and automatic browser language detection.
46
- - [Network Blocker](./docs/frameworks/next/network-blocker.md): Block outgoing network requests to third-party domains until the user grants consent for the appropriate category.
47
- - [Optimization](./docs/frameworks/next/optimization.md): Improve c15t startup performance in Next.js with same-origin rewrites, static prefetching, and dynamic-route SSR.
48
- - [Policy Packs](./docs/frameworks/next/policy-packs.md): Configure regional consent policies in Next.js — hosted mode, presets, and offline fallback.
49
- - [Quickstart](./docs/frameworks/next/quickstart.md): Add consent management to your Next.js app in under 5 minutes.
50
- - [Script Loader](./docs/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.
51
- - [Server-Side Data Fetching](./docs/frameworks/next/server-side.md): Pre-fetch consent data in Server Components with fetchInitialData for dynamic Next.js routes.
52
- - [Class Names](./docs/frameworks/next/styling/classnames.md): Style consent components using className props and per-slot className targeting via the theme.
53
- - [Color Scheme](./docs/frameworks/next/styling/color-scheme.md): Support light mode, dark mode, and system preference detection in consent components.
54
- - [CSS Variables](./docs/frameworks/next/styling/css-variables.md): Reference for all --c15t-* CSS custom properties generated by the theme system.
55
- - [Styling Overview](./docs/frameworks/next/styling/overview.md): Five approaches for theming consent components — design tokens, component slots, CSS variables, className, and noStyle mode.
56
- - [Component Slots](./docs/frameworks/next/styling/slots.md): Target individual component parts with styles using the slot system - className strings or inline style objects.
57
- - [Tailwind CSS](./docs/frameworks/next/styling/tailwind.md): Use Tailwind CSS utility classes to style consent components via the slot system.
58
- - [Design Tokens](./docs/frameworks/next/styling/tokens.md): The six base token categories that control colors, typography, spacing, radius, shadows, and motion, plus optional dark-mode overrides.
59
- - [Troubleshooting](./docs/frameworks/next/troubleshooting.md): Solutions for common issues with @c15t/nextjs — provider errors, missing banners, consent persistence, and more.
27
+ - [Fetching reference](./docs/frameworks/next/api-reference/data-fetching.md): Reference for Next.js consent URLs, manifest resolution, request geography and offline configuration.
28
+ - [App Router](./docs/frameworks/next/app-router.md): Set up App Router with Inth, cached manifests and consent-gated scripts.
29
+ - [Client-side initialization](./docs/frameworks/next/client-side.md): Initialize Next.js consent in the browser with one backend URL, without server prefetch or local API handlers.
30
+ - [ConsentBanner](./docs/frameworks/next/components/consent-banner.md): Render the pre-built ConsentBanner inside a Next.js ConsentRoot and configure its variants, per-policy buttons and compound parts.
31
+ - [ConsentDialog](./docs/frameworks/next/components/consent-dialog.md): Mount ConsentDialog as a Client Component inside a Next.js ConsentRoot to open the preference center from the banner, links and triggers.
32
+ - [ConsentDialogLink](./docs/frameworks/next/components/consent-dialog-link.md): Open the preference center from a Next.js footer with ConsentDialogLink, a Client Component that renders an unstyled button inside ConsentRoot.
33
+ - [ConsentDialogTrigger](./docs/frameworks/next/components/consent-dialog-trigger.md): Add the floating ConsentDialogTrigger button or toolbar to a Next.js ConsentRoot so visitors can reopen the preference center.
34
+ - [ConsentRoot](./docs/frameworks/next/components/consent-manager-provider.md): Pass server-resolved consent state and shared configuration to the Next.js ConsentRoot.
35
+ - [ConsentWidget](./docs/frameworks/next/components/consent-widget.md): Render ConsentWidget on a Next.js privacy page inside ConsentRoot as an inline preference center, server-rendered when the route resolves consent.
36
+ - [DevTools](./docs/frameworks/next/components/dev-tools.md): Load the c15t DevTools panel only in Next.js development builds to inspect consent state, scripts, policy and events inside ConsentRoot.
37
+ - [Frame](./docs/frameworks/next/components/frame.md): Consent-gate an iframe in Next.js with Frame inside ConsentRoot; with server prefetch the placeholder or embed is decided in the server HTML.
38
+ - [Consent categories](./docs/frameworks/next/concepts/consent-categories.md): Assign optional features to categories and understand how policy scope affects permission.
39
+ - [Policy presets](./docs/frameworks/next/concepts/policy-presets.md): Understand how policy rules affect Next.js prompts, permissions and persistent privacy controls.
40
+ - [Content Security Policy](./docs/frameworks/next/content-security-policy.md): Pass a per-request CSP nonce to ConsentRoot in Next.js and allow the consent backend in connect-src.
41
+ - [Data fetching](./docs/frameworks/next/data-fetching.md): Choose cached manifests for a Next.js server, backend initialization for a simpler setup, or offline mode for local development.
42
+ - [Forward geography headers](./docs/frameworks/next/geography-headers.md): Use c15tProxy in Next.js proxy.ts or middleware.ts so Server Components and Route Handlers receive the visitor's country and region.
43
+ - [Headless](./docs/frameworks/next/headless.md): Build a custom consent banner in Next.js with the c15t/next/headless hooks inside your existing ConsentRoot.
44
+ - [Hooks](./docs/frameworks/next/hooks/use-consent-manager/overview.md): Gate features and save consent choices in Next.js Client Components with the focused hooks exported from c15t/next.
45
+ - [IAB TCF](./docs/frameworks/next/iab/overview.md): Mount the IAB TCF banner and dialog inside a Next.js ConsentRoot and configure the CMP ID, policy and vendor data.
46
+ - [Optimization](./docs/frameworks/next/optimization.md): Reuse cached policy data and optionally reduce browser connection overhead without changing consent behavior.
47
+ - [Pages Router](./docs/frameworks/next/pages-router.md): Set up Pages Router with Inth, cached manifests and consent-gated scripts.
48
+ - [Quickstart](./docs/frameworks/next/quickstart.md): Add c15t consent management to Next.js with Inth, with setup guides for the App Router, the Pages Router and static export.
49
+ - [Load scripts with consent](./docs/frameworks/next/script-loader.md): Register vendor scripts in your existing Next.js ConsentRoot and handle loading and revocation.
50
+ - [Server rendering and hydration](./docs/frameworks/next/server-side.md): Resolve consent on the server, choose what waits for the result, and preserve the same state through hydration.
51
+ - [Static export](./docs/frameworks/next/static-export.md): Add c15t to output export without request helpers or a local API server.
52
+ - [Styling](./docs/frameworks/next/styling/overview.md): Import the Next.js stylesheet and theme c15t components with tokens, slots, and class names through ConsentRoot options.
53
+ - [Troubleshoot Next.js consent](./docs/frameworks/next/troubleshooting.md): Diagnose failed Next.js prefetch, verify manifest requests, and fix consent rendering or persistence problems.
54
+
55
+ ## Guides
56
+
57
+ - [Understand consent state](./docs/guides/consent-state.md): Distinguish policy resolution, effective permissions, explicit choices, notices and privacy signals.
58
+ - [Data fetching and transports](./docs/guides/data-fetching.md): Choose cached manifests, backend init or offline policy resolution, and understand where consent records are saved.
59
+ - [Choose a deployment mode](./docs/guides/deployment-modes.md): Choose who runs your consent backend, then select manifest, init or offline resolution for your deployment.
60
+ - [Troubleshoot consent](./docs/guides/troubleshooting.md): Diagnose missing banners, early vendor requests, lost choices and hydration differences.
61
+ - [Verify consent before shipping](./docs/guides/verify-consent.md): Test requests, policy resolution, persistence, navigation and preference changes in a production build.
62
+
63
+ ## Customization
64
+
65
+ - [Customize your consent interface](./docs/customization/overview.md): Choose presentation, theme tokens, slots or custom markup for the change you need.
66
+ - [Banner styling recipes](./docs/customization/recipes.md): See real v3 components and reuse the exact theme configuration behind the examples.
67
+ - [Style component slots](./docs/customization/slots.md): Target a specific c15t component part without replacing its markup or behavior.
68
+ - [Theme tokens and CSS](./docs/customization/tokens.md): Style c15t with semantic tokens and use the stylesheet that matches your CSS tooling.
69
+ - [Copy and translations](./docs/customization/translations.md): Change consent wording through i18n and test the complete prompt and preferences flow.
60
70
 
61
71
  ## Integrations
62
72
 
63
- Connect analytics, advertising, maps, media, and other third-party tools behind consent.
64
-
65
- - [Adobe Analytics](./docs/integrations/adobe-analytics.md): Adobe Analytics loaded through an Adobe Experience Platform Data Collection Tags embed URL.
66
- - [Ahrefs Analytics](./docs/integrations/ahrefs-analytics.md): Cookieless web analytics from Ahrefs with a prebuilt helper that wires the project key into a c15t-managed script.
67
- - [Amplitude](./docs/integrations/amplitude.md): Load Amplitude Browser SDK 2 with c15t and gate product analytics behind measurement consent.
68
- - [Build a Custom Script Integration](./docs/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.
69
- - [Clearbit](./docs/integrations/clearbit.md): Visitor and company enrichment loaded with Clearbit's account-keyed tags.js snippet.
70
- - [Cloudflare Web Analytics](./docs/integrations/cloudflare-web-analytics.md): Cookieless analytics from Cloudflare with a prebuilt helper that serializes the beacon config into the `data-cf-beacon` attribute.
71
- - [Crisp](./docs/integrations/crisp.md): Load Crisp live chat with website ID, runtime, cookie, and session options.
72
- - [Databuddy](./docs/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.
73
- - [Fathom Analytics](./docs/integrations/fathom-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that maps Fathom's data attributes into a c15t-managed script.
74
- - [Google Maps](./docs/integrations/google-maps.md): Render Google Maps only after consent with one shared Maps JavaScript API loader and independently managed map instances.
75
- - [GA4 + Google Ads (gtag.js)](./docs/integrations/google-tag.md): Send data to Google Analytics 4 and Google Ads with automatic Consent Mode v2 support.
76
- - [Google Tag Manager](./docs/integrations/google-tag-manager.md): Deploy and manage marketing tags centrally with automatic consent state synchronization.
77
- - [Heap](./docs/integrations/heap.md): Load Heap with c15t and gate autocapture product analytics behind measurement consent.
78
- - [Hightouch](./docs/integrations/hightouch.md): Load Hightouch Events with c15t and gate the browser SDK behind measurement consent.
79
- - [Hotjar](./docs/integrations/hotjar.md): Product analytics and behavior insights with a prebuilt helper that seeds Hotjar globals before loading the vendor bundle.
80
- - [Intercom](./docs/integrations/intercom.md): Bootstrap Intercom settings and load the messenger widget bundle.
81
- - [LinkedIn Insights](./docs/integrations/linkedin-insights.md): Track conversions and build matched audiences for LinkedIn advertising campaigns.
82
- - [LogRocket](./docs/integrations/logrocket.md): Session replay and monitoring loaded after measurement consent with LogRocket's browser SDK.
83
- - [Matomo Analytics](./docs/integrations/matomo-analytics.md): Load Matomo with c15t and keep Matomo's queue aligned with measurement consent.
84
- - [Meta Pixel](./docs/integrations/meta-pixel.md): Track conversions and build audiences for Facebook and Instagram advertising campaigns.
85
- - [Microsoft Clarity](./docs/integrations/microsoft-clarity.md): Session replay and behavior analytics with a prebuilt helper that keeps Clarity consent synchronized with c15t measurement state.
86
- - [Microsoft UET](./docs/integrations/microsoft-uet.md): Track conversions and measure performance for Microsoft Advertising and Bing Ads.
87
- - [Mixpanel Analytics](./docs/integrations/mixpanel-analytics.md): Load Mixpanel with c15t and let Mixpanel's own opt-in and opt-out APIs follow measurement consent.
88
- - [Integrations](./docs/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.
89
- - [Pirsch](./docs/integrations/pirsch.md): Privacy-friendly, cookieless analytics loaded with Pirsch's fixed script id and identification-code attributes.
90
- - [Plausible Analytics](./docs/integrations/plausible-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that preserves Plausible's queue bootstrap and loader attributes.
91
- - [PostHog](./docs/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.
92
- - [Promptwatch](./docs/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.
93
- - [Reddit Pixel](./docs/integrations/reddit-pixel.md): Track conversions and build retargeting audiences for Reddit advertising campaigns.
94
- - [RudderStack](./docs/integrations/rudderstack.md): Load RudderStack's JavaScript SDK with c15t and gate the browser SDK behind measurement consent.
95
- - [Rybbit Analytics](./docs/integrations/rybbit-analytics.md): Privacy-friendly analytics with script-tag configuration via Rybbit's data attributes.
96
- - [Segment](./docs/integrations/segment.md): Load Segment Analytics.js with c15t and gate it behind measurement consent.
97
- - [Snapchat Pixel](./docs/integrations/snapchat-pixel.md): Measure Snapchat ad performance and build remarketing audiences with a prebuilt pixel helper.
98
- - [TikTok Pixel](./docs/integrations/tiktok-pixel.md): Measure ad performance and build audiences for TikTok advertising campaigns.
99
- - [Umami Analytics](./docs/integrations/umami-analytics.md): Open-source, cookieless analytics with a prebuilt helper that maps Umami's data attributes into a c15t-managed script.
100
- - [Vercel Analytics](./docs/integrations/vercel-analytics.md): Bootstrap Vercel Analytics with a declarative queue and script attributes.
101
- - [X Pixel (Twitter Pixel)](./docs/integrations/x-pixel.md): Track conversions and build audiences for advertising campaigns on X (formerly Twitter).
102
- - [YouTube](./docs/integrations/youtube.md): Keep YouTube iframes unmounted until consent with a privacy-enhanced, lazy-loaded React or Next.js embed.
73
+ - [Adobe Analytics](./docs/integrations/adobe-analytics.md): Configure Adobe Analytics with c15t v3, understand measurement permission and verify loading and revocation.
74
+ - [Ahrefs Analytics](./docs/integrations/ahrefs-analytics.md): Configure Ahrefs Analytics with c15t v3, understand measurement permission and verify loading and revocation.
75
+ - [Amplitude](./docs/integrations/amplitude.md): Configure Amplitude with c15t v3, understand measurement permission and verify loading and revocation.
76
+ - [Custom integrations](./docs/integrations/building-integrations.md): Define loading, initialization and consent-change behavior for a vendor without a helper.
77
+ - [Clearbit](./docs/integrations/clearbit.md): Configure Clearbit with c15t v3, understand marketing permission and verify loading and revocation.
78
+ - [Cloudflare Web Analytics](./docs/integrations/cloudflare-web-analytics.md): Configure Cloudflare Web Analytics with c15t v3, understand measurement permission and verify loading and revocation.
79
+ - [Crisp](./docs/integrations/crisp.md): Configure Crisp with c15t v3, understand functionality permission and verify loading and revocation.
80
+ - [Databuddy](./docs/integrations/databuddy.md): Configure Databuddy's initial and updated consent state with c15t v3.
81
+ - [Fathom Analytics](./docs/integrations/fathom-analytics.md): Configure Fathom Analytics with c15t v3, understand measurement permission and verify loading and revocation.
82
+ - [Google Maps](./docs/integrations/google-maps.md): Prevent a map iframe from mounting before the required permission.
83
+ - [Google Tag](./docs/integrations/google-tag.md): Configure gtag with c15t Consent Mode signals and understand its loading behavior.
84
+ - [Google Tag Manager](./docs/integrations/google-tag-manager.md): Load GTM with c15t consent signals and verify the tags inside your container.
85
+ - [Heap](./docs/integrations/heap.md): Configure Heap with c15t v3, understand measurement permission and verify loading and revocation.
86
+ - [Hightouch](./docs/integrations/hightouch.md): Configure Hightouch with c15t v3, understand measurement permission and verify loading and revocation.
87
+ - [Hotjar](./docs/integrations/hotjar.md): Configure Hotjar with c15t v3, understand measurement permission and verify loading and revocation.
88
+ - [Intercom](./docs/integrations/intercom.md): Load the Intercom messenger with functionality permission and configure its region.
89
+ - [LinkedIn Insight Tag](./docs/integrations/linkedin-insights.md): Configure LinkedIn Insight Tag with c15t v3, understand marketing permission and verify loading and revocation.
90
+ - [LogRocket](./docs/integrations/logrocket.md): Configure LogRocket with c15t v3, understand measurement permission and verify loading and revocation.
91
+ - [Matomo Analytics](./docs/integrations/matomo-analytics.md): Choose gated loading or Matomo consent signaling and configure the correct tracker endpoints.
92
+ - [Meta Pixel](./docs/integrations/meta-pixel.md): Register the Meta Pixel under marketing permission and verify event calls after revocation.
93
+ - [Microsoft Clarity](./docs/integrations/microsoft-clarity.md): Configure Microsoft Clarity with c15t v3, understand measurement permission and verify loading and revocation.
94
+ - [Microsoft UET](./docs/integrations/microsoft-uet.md): Configure Microsoft UET with c15t v3, understand marketing permission and verify loading and revocation.
95
+ - [Mixpanel](./docs/integrations/mixpanel-analytics.md): Configure Mixpanel with c15t v3, understand measurement permission and verify loading and revocation.
96
+ - [OpenAI Pixel](./docs/integrations/openai-pixel.md): Configure the OpenAI Measurement Pixel for ChatGPT Ads with c15t v3, manage marketing permission and verify conversion delivery.
97
+ - [Overview](./docs/integrations/overview.md): Find all c15t integrations for analytics, tag managers, advertising, chat and embedded content.
98
+ - [Pirsch](./docs/integrations/pirsch.md): Configure Pirsch with c15t v3, understand measurement permission and verify loading and revocation.
99
+ - [Plausible Analytics](./docs/integrations/plausible-analytics.md): Configure Plausible Analytics with c15t v3, understand measurement permission and verify loading and revocation.
100
+ - [PostHog](./docs/integrations/posthog.md): Choose PostHog loading and cookieless behavior, configure the region, and synchronize v3 permissions.
101
+ - [Promptwatch](./docs/integrations/promptwatch.md): Configure Promptwatch with c15t v3, understand measurement permission and verify loading and revocation.
102
+ - [Reddit Pixel](./docs/integrations/reddit-pixel.md): Configure Reddit Pixel with c15t v3, understand marketing permission and verify loading and revocation.
103
+ - [RudderStack](./docs/integrations/rudderstack.md): Gate the RudderStack browser SDK or map c15t categories to destination consent IDs.
104
+ - [Rybbit Analytics](./docs/integrations/rybbit-analytics.md): Configure Rybbit Analytics with c15t v3, understand measurement permission and verify loading and revocation.
105
+ - [Segment](./docs/integrations/segment.md): Configure Segment with c15t v3, understand measurement permission and verify loading and revocation.
106
+ - [Snapchat Pixel](./docs/integrations/snapchat-pixel.md): Configure Snapchat Pixel with c15t v3, understand marketing permission and verify loading and revocation.
107
+ - [TikTok Pixel](./docs/integrations/tiktok-pixel.md): Configure TikTok Pixel with c15t v3, understand marketing permission and verify loading and revocation.
108
+ - [Umami Analytics](./docs/integrations/umami-analytics.md): Configure Umami Analytics with c15t v3, understand measurement permission and verify loading and revocation.
109
+ - [Vercel Analytics](./docs/integrations/vercel-analytics.md): Configure Vercel Analytics with c15t v3, understand measurement permission and verify loading and revocation.
110
+ - [X Pixel](./docs/integrations/x-pixel.md): Configure X Pixel with c15t v3, understand marketing permission and verify loading and revocation.
111
+ - [YouTube](./docs/integrations/youtube.md): Gate YouTube embeds with c15t v3 in Next.js, TanStack Start, React, Nuxt, Vue, Astro, Svelte, SvelteKit or JavaScript.
103
112
 
104
113
  ## Reference
105
114
 
106
- Concepts, legal templates, open-source policies, and contributor documentation.
107
-
108
- - [Client Modes](./docs/shared/concepts/client-modes.md): Reference page for client modes.
109
- - [Consent Categories](./docs/shared/concepts/consent-categories.md): Reference page for consent categories.
110
- - [Consent Models](./docs/shared/concepts/consent-models.md): Reference page for consent models.
111
- - [Cookie Management](./docs/shared/concepts/cookie-management.md): Reference page for cookie management.
112
- - [Glossary](./docs/shared/concepts/glossary.md): Reference page for glossary.
113
- - [Initialization Flow](./docs/shared/concepts/initialization-flow.md): Reference page for initialization flow.
114
- - [Policy Packs](./docs/shared/concepts/policy-packs.md): Reference page for policy packs.
115
- - [Consent Banner](./docs/shared/react/components/consent-banner.md): Reference page for consent banner.
116
- - [Consent Dialog](./docs/shared/react/components/consent-dialog.md): Reference page for consent dialog.
117
- - [Consent Dialog Link](./docs/shared/react/components/consent-dialog-link.md): Reference page for consent dialog link.
118
- - [Consent Dialog Trigger](./docs/shared/react/components/consent-dialog-trigger.md): Reference page for consent dialog trigger.
119
- - [Consent Manager Provider](./docs/shared/react/components/consent-manager-provider.md): Reference page for consent manager provider.
120
- - [Consent Widget](./docs/shared/react/components/consent-widget.md): Reference page for consent widget.
121
- - [Dev Tools](./docs/shared/react/components/dev-tools.md): Reference page for dev tools.
122
- - [Frame](./docs/shared/react/components/frame.md): Reference page for frame.
123
- - [Building Headless Components](./docs/shared/react/guides/building-headless-components.md): Reference page for building headless components.
124
- - [Callbacks](./docs/shared/react/guides/callbacks.md): Reference page for callbacks.
125
- - [Headless](./docs/shared/react/guides/headless.md): Reference page for headless.
126
- - [Iframe Blocking](./docs/shared/react/guides/iframe-blocking.md): Reference page for iframe blocking.
127
- - [Internationalization](./docs/shared/react/guides/internationalization.md): Reference page for internationalization.
128
- - [Network Blocker](./docs/shared/react/guides/network-blocker.md): Reference page for network blocker.
129
- - [Optimization](./docs/shared/react/guides/optimization.md): Reference page for optimization.
130
- - [Policy Packs](./docs/shared/react/guides/policy-packs.md): Reference page for policy packs.
131
- - [Script Loader](./docs/shared/react/guides/script-loader.md): Reference page for script loader.
132
- - [Use Color Scheme](./docs/shared/react/hooks/use-color-scheme.md): Reference page for use color scheme.
133
- - [Checking Consent](./docs/shared/react/hooks/use-consent-manager/checking-consent.md): Reference page for checking consent.
134
- - [Location Info](./docs/shared/react/hooks/use-consent-manager/location-info.md): Reference page for location info.
135
- - [Overview](./docs/shared/react/hooks/use-consent-manager/overview.md): Reference page for overview.
136
- - [Setting Consent](./docs/shared/react/hooks/use-consent-manager/setting-consent.md): Reference page for setting consent.
137
- - [Use Draggable](./docs/shared/react/hooks/use-draggable.md): Reference page for use draggable.
138
- - [Use Focus Trap](./docs/shared/react/hooks/use-focus-trap.md): Reference page for use focus trap.
139
- - [Use Reduced Motion](./docs/shared/react/hooks/use-reduced-motion.md): Reference page for use reduced motion.
140
- - [Use SSR Status](./docs/shared/react/hooks/use-ssr-status.md): Reference page for use ssr status.
141
- - [Use Text Direction](./docs/shared/react/hooks/use-text-direction.md): Reference page for use text direction.
142
- - [Use Translations](./docs/shared/react/hooks/use-translations.md): Reference page for use translations.
143
- - [Consent Banner](./docs/shared/react/iab/consent-banner.md): Reference page for consent banner.
144
- - [Consent Dialog](./docs/shared/react/iab/consent-dialog.md): Reference page for consent dialog.
145
- - [Overview](./docs/shared/react/iab/overview.md): Reference page for overview.
146
- - [Use GVL Data](./docs/shared/react/iab/use-gvl-data.md): Reference page for use gvl data.
147
- - [Classnames](./docs/shared/react/styling/classnames.md): Reference page for classnames.
148
- - [Color Scheme](./docs/shared/react/styling/color-scheme.md): Reference page for color scheme.
149
- - [CSS Variables](./docs/shared/react/styling/css-variables.md): Reference page for css variables.
150
- - [Overview](./docs/shared/react/styling/overview.md): Reference page for overview.
151
- - [Slots](./docs/shared/react/styling/slots.md): Reference page for slots.
152
- - [Stylesheet Entrypoint](./docs/shared/react/styling/stylesheet-entrypoint.md): Reference page for stylesheet entrypoint.
153
- - [Tailwind](./docs/shared/react/styling/tailwind.md): Reference page for tailwind.
154
- - [Tokens](./docs/shared/react/styling/tokens.md): Reference page for tokens.
155
- - [Troubleshooting](./docs/shared/troubleshooting.md): Reference page for troubleshooting.
115
+ - [Upgrade to v3 policies](./docs/upgrade-v3.md): Migrate policy configuration, consent records, callbacks, and custom transports to the v3 policy system.
package/README.md CHANGED
@@ -15,14 +15,14 @@
15
15
  <a href="https://github.com/c15t/c15t/blob/main/LICENSE.md"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/github/c15t/c15t/license.svg?variant=outline&mode=dark"><img src="https://shieldcn.dev/github/c15t/c15t/license.svg?variant=outline&mode=light" alt="License"></picture></a>
16
16
  <a href="https://c15t.link/discord"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/discord/1312171102268690493.svg?variant=outline&mode=dark"><img src="https://shieldcn.dev/discord/1312171102268690493.svg?variant=outline&mode=light" alt="Discord"></picture></a>
17
17
  <a href="https://skills.sh/c15t/skills/c15t"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/skills/c15t/skills/c15t.svg?variant=outline&mode=dark"><img src="https://shieldcn.dev/skills/c15t/skills/c15t.svg?variant=outline&mode=light" alt="Skills"></picture></a>
18
- <a href="https://inth.com?utm_source=npm&utm_medium=readme&utm_campaign=oss_readme&utm_content=%40c15t%2Fnextjs"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Made%20By-Inth-ffc803.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzOTMgNDAwIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTgyLjY2MiAwdjM2Ljg5NWgtNTkuMDMxdjgyLjczM2g1OS4wMzF2MzYuODkzSDI3LjQ4MnYtMzYuODkzaDU5LjAzVjM2Ljg5NWgtNTkuMDNWMHpNMzIxLjk0MSA4OS44NVYwaDM1LjM1NXYxNTYuNTIxaC0yNS43MTNsLTg2LjEzNy05MC4zNjR2OTAuMzY0aC0zNS4zNTVWMGgyNi4zNTV6Ii8%2BPHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzE4LjU3MSAxODUuNzE0aDc0LjI4NlY0MDBIMFYxODUuNzE0aDI3Mi44NTd2LTQ3LjE0M3ptLTI5MS4wOSAyOC45Njl2MzcuMTE4aDU4LjEzN3YxMTkuNjI4aDM2Ljg5NVYyNTEuODAxaDU4LjU4NHYtMzcuMTE4em0xODIuNjEuMjI0djE1Ni41MjJoMzYuODk0VjMxMy41OWg3My4zNDF2NTcuODM5aDM3LjExOFYyMTQuOTA3aC0zNy4xMTh2NjEuNzg4aC03My4zNDF2LTYxLjc4OHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D&color=ffc803&labelTextColor=000000&valueColor=000000&mode=dark"><img src="https://shieldcn.dev/badge/Made%20By-Inth-ffc803.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzOTMgNDAwIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTgyLjY2MiAwdjM2Ljg5NWgtNTkuMDMxdjgyLjczM2g1OS4wMzF2MzYuODkzSDI3LjQ4MnYtMzYuODkzaDU5LjAzVjM2Ljg5NWgtNTkuMDNWMHpNMzIxLjk0MSA4OS44NVYwaDM1LjM1NXYxNTYuNTIxaC0yNS43MTNsLTg2LjEzNy05MC4zNjR2OTAuMzY0aC0zNS4zNTVWMGgyNi4zNTV6Ii8%2BPHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzE4LjU3MSAxODUuNzE0aDc0LjI4NlY0MDBIMFYxODUuNzE0aDI3Mi44NTd2LTQ3LjE0M3ptLTI5MS4wOSAyOC45Njl2MzcuMTE4aDU4LjEzN3YxMTkuNjI4aDM2Ljg5NVYyNTEuODAxaDU4LjU4NHYtMzcuMTE4em0xODIuNjEuMjI0djE1Ni41MjJoMzYuODk0VjMxMy41OWg3My4zNDF2NTcuODM5aDM3LjExOFYyMTQuOTA3aC0zNy4xMTh2NjEuNzg4aC03My4zNDF2LTYxLjc4OHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D&color=ffc803&labelTextColor=000000&valueColor=000000&mode=light" alt="Made by Inth"></picture></a>
18
+ <a href="https://inth.com?utm_source=npm&utm_medium=readme&utm_campaign=oss_readme&utm_content=%40c15t%2Fnextjs"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Made%20By-Inth-ffc803.svg?color=ffc803&labelTextColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzOTMgNDAwIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTgyLjY2MiAwdjM2Ljg5NWgtNTkuMDMxdjgyLjczM2g1OS4wMzF2MzYuODkzSDI3LjQ4MnYtMzYuODkzaDU5LjAzVjM2Ljg5NWgtNTkuMDNWMHpNMzIxLjk0MSA4OS44NVYwaDM1LjM1NXYxNTYuNTIxaC0yNS43MTNsLTg2LjEzNy05MC4zNjR2OTAuMzY0aC0zNS4zNTVWMGgyNi4zNTV6Ii8%2BPHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzE4LjU3MSAxODUuNzE0aDc0LjI4NlY0MDBIMFYxODUuNzE0aDI3Mi44NTd2LTQ3LjE0M3ptLTI5MS4wOSAyOC45Njl2MzcuMTE4aDU4LjEzN3YxMTkuNjI4aDM2Ljg5NVYyNTEuODAxaDU4LjU4NHYtMzcuMTE4em0xODIuNjEuMjI0djE1Ni41MjJoMzYuODk0VjMxMy41OWg3My4zNDF2NTcuODM5aDM3LjExOFYyMTQuOTA3aC0zNy4xMTh2NjEuNzg4aC03My4zNDF2LTYxLjc4OHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D&valueColor=000000&mode=dark"><img src="https://shieldcn.dev/badge/Made%20By-Inth-ffc803.svg?color=ffc803&labelTextColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAzOTMgNDAwIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTgyLjY2MiAwdjM2Ljg5NWgtNTkuMDMxdjgyLjczM2g1OS4wMzF2MzYuODkzSDI3LjQ4MnYtMzYuODkzaDU5LjAzVjM2Ljg5NWgtNTkuMDNWMHpNMzIxLjk0MSA4OS44NVYwaDM1LjM1NXYxNTYuNTIxaC0yNS43MTNsLTg2LjEzNy05MC4zNjR2OTAuMzY0aC0zNS4zNTVWMGgyNi4zNTV6Ii8%2BPHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzE4LjU3MSAxODUuNzE0aDc0LjI4NlY0MDBIMFYxODUuNzE0aDI3Mi44NTd2LTQ3LjE0M3ptLTI5MS4wOSAyOC45Njl2MzcuMTE4aDU4LjEzN3YxMTkuNjI4aDM2Ljg5NVYyNTEuODAxaDU4LjU4NHYtMzcuMTE4em0xODIuNjEuMjI0djE1Ni41MjJoMzYuODk0VjMxMy41OWg3My4zNDF2NTcuODM5aDM3LjExOFYyMTQuOTA3aC0zNy4xMTh2NjEuNzg4aC03My4zNDF2LTYxLjc4OHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg%3D%3D&valueColor=000000&mode=light" alt="Made by Inth"></picture></a>
19
19
  </p>
20
20
 
21
21
  Next.js cookie banner and consent management platform for App Router, Pages Router, SSR, and headless consent flows.
22
22
 
23
23
  ## Key Features
24
24
 
25
- - Works with Next.js 16, 15, 14, and 13
25
+ - Works with Next.js 16 and 15
26
26
  - Full 'use client' support for React Server Components
27
27
  - Server-side rendering support for both app and pages routers
28
28
  - Prebuilt and customizable cookie banner, consent dialog, and preference center UI
@@ -35,9 +35,9 @@ Next.js cookie banner and consent management platform for App Router, Pages Rout
35
35
 
36
36
  ## Prerequisites
37
37
 
38
- - Next.js 13.5.4 or later
38
+ - Next.js 15.0.0 or later
39
39
  - React 18 or later
40
- - Node.js 18.17.0 or later
40
+ - Node.js 20.19 or later
41
41
  - A hosted [c15t instance](https://inth.com) (free sign-up), [self-hosted deployment](https://c15t.com/docs/self-host/quickstart), or offline mode for local-only storage
42
42
 
43
43
  ## Quick Start
package/dist/api.js ADDED
@@ -0,0 +1 @@
1
+ import{c15tProtocolHeaders as e,deferInitGvlToRoute as t,fetchCachedGvl as a,serveGvlReference as n}from"@c15t/core";import{fetchCachedManifest as r,getManifestAge as i,parseCacheDirectiveSeconds as o}from"@c15t/core/libs/manifest-cache";import{POLICY_CONTRACT_HEADER as s,POLICY_CONTRACT_VERSION as l,resolveBackendURL as c,resolveInitFromManifest as f}from"@c15t/schema/types";import{baseTranslations as u}from"@c15t/translations/all";import{defineConsentConfig as h,isConsentConfig as g}from"./config.js";import{extractConsentRequestInputs as d}from"./headers.js";let p=function(e){if("u">typeof process)return process.env?.[e]},m=function(){let e=p("C15T_MANIFEST_REVALIDATE_SECONDS");if(void 0===e)return;if("false"===e)return!1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0},T=function(e){let t={host:new URL(e.url).host};for(let a of["x-forwarded-proto","x-forwarded-ssl","x-forwarded-host","host","referer"]){let n=e.headers.get(a);n&&(t[a]=n)}return t},v=function(e,t){return c(e,T(t))},R=function(e,t){let a=t.manifestURL??p("C15T_MANIFEST_URL");if(a){let t=v(a,e);if(!t)throw Error("@c15t/nextjs/api: invalid C15T_MANIFEST_URL.");return t}let n=t.backendURL??p("C15T_BACKEND_URL")??p("NEXT_PUBLIC_C15T_BACKEND_URL");if(!n)throw Error("@c15t/nextjs/api: configure C15T_BACKEND_URL or C15T_MANIFEST_URL.");let r=v(n,e);if(!r)throw Error("@c15t/nextjs/api: invalid C15T_BACKEND_URL.");return`${r}/manifest`},_=function(e,t){if(!t)return e;let a=new URL(e);return a.searchParams.set("language",t),a.toString()},C=function(e){return o(e,"s-maxage")},E=function(e){return e.manifestRevalidateSeconds??m()??300},b=function(t={}){let a=E(t);return{headers:{accept:"application/json",...e},method:"GET",next:{revalidate:a}}},w=async function(e,t={},a){let n=_(R(e,t),a??null),{headers:o,method:s,...l}=b(t),c=await r({fetch:t.fetch,headers:o,init:l,onBackgroundRevalidate:t.onBackgroundRevalidate,url:n}),f=c.headers["cache-control"]??"public, s-maxage=300, stale-while-revalidate=86400",u=C(f)??E(t);return{age:i(c),cacheControl:f,etag:c.headers.etag,manifest:c.manifest,revalidate:u,status:200}},x=function(t){return a({fetch:t.fetch,headers:e,label:"@c15t/nextjs/api",language:t.language,url:t.reference.url})},S=function(e){if(!g(e))return e;let{initURL:t,manifestURL:a,...n}=e;return n},L=function(e={}){let a=S(e);return{async GET(e){let{manifest:r}=await w(e,a),i=await n(e,e=>r.iab?.gvl?(a.fetchGvl??x)({fetch:a.fetch??globalThis.fetch.bind(globalThis),language:e,reference:r.iab.gvl}):Promise.resolve(null));if(i)return i;let o=f(r,d(e.headers),{baseTranslations:u}),c=e.headers.get(s);if(null!==c&&c.trim()!==String(l)&&(o.policyResolution={policy:null,reason:"unsupported-contract",status:"failed",version:l},delete o.policySnapshotToken,delete o.gvl),r.iab?.enabled===!0&&void 0!==r.iab.gvl&&o.policyResolution?.status==="matched"&&"iab"===o.policyResolution.policy.model&&r.iab?.gvl){let e=o.translations.language.split("-")[0]||"en";o.gvl=await (a.fetchGvl??x)({fetch:a.fetch??globalThis.fetch.bind(globalThis),language:e,reference:r.iab.gvl})}return Response.json(t(o,new URL(e.url).pathname),{headers:{"cache-control":"private, no-store",[s]:String(l)}})},async manifestGET(e){let t=new URL(e.url),n=await w(e,a,t.searchParams.get("language")),r=new Headers({age:String(n.age),"cache-control":n.cacheControl,"content-type":"application/json",[s]:String(l)});return n.etag&&r.set("etag",n.etag),r.set("x-c15t-next-revalidate",String(n.revalidate)),new Response(JSON.stringify(n.manifest),{headers:r,status:200})}}},N=L(),{GET:U}=N,{manifestGET:y}=N;export{U as GET,b as createManifestFetchInit,L as createNextConsentRouteHandlers,w as fetchCachedManifest,C as getSMaxAge,h as defineConsentConfig,y as manifestGET};
package/dist/config.js ADDED
@@ -0,0 +1 @@
1
+ let t=Symbol.for("@c15t/nextjs/consent-config"),e=function(t){if(t.startsWith("/"))return!t.startsWith("//");try{let e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol}catch{return!1}},n=function(t,n,i){if(void 0===n){if(i)throw TypeError(`@c15t/nextjs: defineConsentConfig needs \`${t}\`.`);return}if("string"!=typeof n||!e(n))throw TypeError(`@c15t/nextjs: defineConsentConfig \`${t}\` must be an absolute http(s) URL or a \`/\`-relative path, received ${JSON.stringify(n)}.`)},i=function(e){if("object"!=typeof e||null===e)throw TypeError("@c15t/nextjs: defineConsentConfig expects an object with `backendURL`.");return n("backendURL",e.backendURL,!0),n("manifestURL",e.manifestURL,!1),n("initURL",e.initURL,!1),e.initURL&&!e.manifestURL&&"production"!==globalThis.process?.env?.NODE_ENV&&console.warn("[c15t] defineConsentConfig: `initURL` without `manifestURL` sends browser init through `initURL`, but `resolveConsent` still calls the backend `/init` on every request. Set `manifestURL` to the same-origin manifest route so the server resolves init from the cached manifest too."),Object.freeze({[t]:!0,backendURL:e.backendURL,initURL:e.initURL,manifestURL:e.manifestURL})},o=function(e){return"object"==typeof e&&null!==e&&!0===e[t]};export{i as defineConsentConfig,o as isConsentConfig};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export*from"@c15t/react/devtools";
@@ -0,0 +1 @@
1
+ export{CONSENT_REQUEST_HEADER_NAMES,COUNTRY_HEADERS,REGION_HEADERS,consentInputsToOverrides,extractConsentRequestInputs,parseGlobalPrivacyControl}from"@c15t/schema/types";
@@ -9,4 +9,4 @@
9
9
  * @import "@c15t/nextjs/styles.css";
10
10
  * @import "@c15t/nextjs/iab/styles.css";
11
11
  */
12
- @import "@c15t/react/iab/styles.css";
12
+ @import '@c15t/react/iab/styles.css';