@c15t/nextjs 2.1.0 → 2.2.1

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 (162) hide show
  1. package/AGENTS.md +155 -0
  2. package/README.md +31 -15
  3. package/client/components/integrations.js +3 -0
  4. package/dist/components/integrations/index.cjs +1 -0
  5. package/dist/components/integrations/index.js +1 -0
  6. package/dist/headless.cjs +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/libs/browser-initial-data.cjs +1 -1
  9. package/dist/libs/initial-data.cjs +1 -1
  10. package/dist/styles.tw3.css +1 -1
  11. package/dist/version.cjs +1 -1
  12. package/dist/version.js +1 -1
  13. package/dist-types/components/integrations/index.d.ts +1 -0
  14. package/dist-types/libs/browser-initial-data.d.ts +1 -1
  15. package/dist-types/version.d.ts +1 -1
  16. package/docs/README.md +155 -73
  17. package/docs/{building-headless-components.md → frameworks/next/building-headless-components.md} +3 -1
  18. package/docs/{callbacks.md → frameworks/next/callbacks.md} +3 -1
  19. package/docs/{components → frameworks/next/components}/consent-banner.md +10 -21
  20. package/docs/{components → frameworks/next/components}/consent-dialog-link.md +8 -5
  21. package/docs/frameworks/next/components/consent-dialog-trigger.md +202 -0
  22. package/docs/{components → frameworks/next/components}/consent-dialog.md +7 -15
  23. package/docs/frameworks/next/components/consent-manager-provider.md +327 -0
  24. package/docs/{components → frameworks/next/components}/consent-widget.md +8 -6
  25. package/docs/{components → frameworks/next/components}/dev-tools.md +9 -6
  26. package/docs/{components → frameworks/next/components}/frame.md +8 -9
  27. package/docs/{concepts → frameworks/next/concepts}/client-modes.md +4 -2
  28. package/docs/{concepts → frameworks/next/concepts}/consent-categories.md +1 -0
  29. package/docs/{concepts → frameworks/next/concepts}/consent-models.md +1 -0
  30. package/docs/{concepts → frameworks/next/concepts}/cookie-management.md +3 -3
  31. package/docs/{concepts → frameworks/next/concepts}/glossary.md +1 -0
  32. package/docs/{concepts → frameworks/next/concepts}/initialization-flow.md +1 -0
  33. package/docs/{concepts → frameworks/next/concepts}/policy-packs.md +1 -0
  34. package/docs/{headless.md → frameworks/next/headless.md} +3 -1
  35. package/docs/{hooks → frameworks/next/hooks}/use-color-scheme.md +1 -0
  36. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/checking-consent.md +3 -1
  37. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/location-info.md +3 -1
  38. package/docs/frameworks/next/hooks/use-consent-manager/overview.md +185 -0
  39. package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/setting-consent.md +3 -1
  40. package/docs/{hooks → frameworks/next/hooks}/use-draggable.md +3 -1
  41. package/docs/{hooks → frameworks/next/hooks}/use-focus-trap.md +1 -0
  42. package/docs/{hooks → frameworks/next/hooks}/use-reduced-motion.md +3 -1
  43. package/docs/{hooks → frameworks/next/hooks}/use-ssr-status.md +6 -5
  44. package/docs/{hooks → frameworks/next/hooks}/use-text-direction.md +1 -0
  45. package/docs/frameworks/next/hooks/use-translations.md +55 -0
  46. package/docs/{iab → frameworks/next/iab}/consent-banner.md +9 -12
  47. package/docs/{iab → frameworks/next/iab}/consent-dialog.md +9 -14
  48. package/docs/{iab → frameworks/next/iab}/overview.md +4 -2
  49. package/docs/{iab → frameworks/next/iab}/use-gvl-data.md +3 -2
  50. package/docs/{iframe-blocking.md → frameworks/next/iframe-blocking.md} +8 -9
  51. package/docs/{internationalization.md → frameworks/next/internationalization.md} +13 -3
  52. package/docs/{network-blocker.md → frameworks/next/network-blocker.md} +13 -51
  53. package/docs/{optimization.md → frameworks/next/optimization.md} +5 -4
  54. package/docs/{policy-packs.md → frameworks/next/policy-packs.md} +3 -1
  55. package/docs/{quickstart.md → frameworks/next/quickstart.md} +26 -42
  56. package/docs/{script-loader.md → frameworks/next/script-loader.md} +72 -90
  57. package/docs/{server-side.md → frameworks/next/server-side.md} +12 -15
  58. package/docs/{styling → frameworks/next/styling}/classnames.md +3 -1
  59. package/docs/{styling → frameworks/next/styling}/color-scheme.md +3 -1
  60. package/docs/frameworks/next/styling/css-variables.md +53 -0
  61. package/docs/frameworks/next/styling/overview.md +299 -0
  62. package/docs/frameworks/next/styling/slots.md +94 -0
  63. package/docs/{styling → frameworks/next/styling}/tailwind.md +3 -1
  64. package/docs/frameworks/next/styling/tokens.md +156 -0
  65. package/docs/{troubleshooting.md → frameworks/next/troubleshooting.md} +3 -1
  66. package/docs/integrations/adobe-analytics.md +160 -0
  67. package/docs/integrations/ahrefs-analytics.md +15 -82
  68. package/docs/integrations/amplitude.md +230 -0
  69. package/docs/integrations/building-integrations.md +15 -181
  70. package/docs/integrations/clearbit.md +130 -0
  71. package/docs/integrations/cloudflare-web-analytics.md +15 -83
  72. package/docs/integrations/crisp.md +13 -87
  73. package/docs/integrations/databuddy.md +16 -85
  74. package/docs/integrations/fathom-analytics.md +15 -86
  75. package/docs/integrations/google-maps.md +263 -0
  76. package/docs/integrations/google-tag-manager.md +18 -86
  77. package/docs/integrations/google-tag.md +15 -84
  78. package/docs/integrations/heap.md +219 -0
  79. package/docs/integrations/hightouch.md +199 -0
  80. package/docs/integrations/hotjar.md +15 -83
  81. package/docs/integrations/intercom.md +13 -83
  82. package/docs/integrations/linkedin-insights.md +15 -82
  83. package/docs/integrations/logrocket.md +175 -0
  84. package/docs/integrations/matomo-analytics.md +13 -88
  85. package/docs/integrations/meta-pixel.md +33 -316
  86. package/docs/integrations/microsoft-clarity.md +15 -83
  87. package/docs/integrations/microsoft-uet.md +16 -83
  88. package/docs/integrations/mixpanel-analytics.md +15 -83
  89. package/docs/integrations/overview.md +55 -6
  90. package/docs/integrations/pirsch.md +142 -0
  91. package/docs/integrations/plausible-analytics.md +14 -97
  92. package/docs/integrations/posthog.md +26 -98
  93. package/docs/integrations/promptwatch.md +16 -82
  94. package/docs/integrations/reddit-pixel.md +27 -122
  95. package/docs/integrations/rudderstack.md +271 -0
  96. package/docs/integrations/rybbit-analytics.md +15 -94
  97. package/docs/integrations/segment.md +15 -82
  98. package/docs/integrations/snapchat-pixel.md +21 -102
  99. package/docs/integrations/tiktok-pixel.md +13 -81
  100. package/docs/integrations/umami-analytics.md +16 -88
  101. package/docs/integrations/vercel-analytics.md +13 -85
  102. package/docs/integrations/x-pixel.md +27 -102
  103. package/docs/integrations/youtube.md +193 -0
  104. package/docs/shared/concepts/client-modes.md +103 -0
  105. package/docs/shared/concepts/consent-categories.md +41 -0
  106. package/docs/shared/concepts/consent-models.md +72 -0
  107. package/docs/shared/concepts/cookie-management.md +88 -0
  108. package/docs/shared/concepts/glossary.md +24 -0
  109. package/docs/shared/concepts/initialization-flow.md +105 -0
  110. package/docs/shared/concepts/policy-packs.md +225 -0
  111. package/docs/shared/react/components/consent-banner.md +242 -0
  112. package/docs/shared/react/components/consent-dialog-link.md +45 -0
  113. package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
  114. package/docs/shared/react/components/consent-dialog.md +119 -0
  115. package/docs/shared/react/components/consent-manager-provider.md +225 -0
  116. package/docs/shared/react/components/consent-widget.md +121 -0
  117. package/docs/shared/react/components/dev-tools.md +81 -0
  118. package/docs/shared/react/components/frame.md +52 -0
  119. package/docs/shared/react/guides/building-headless-components.md +110 -0
  120. package/docs/shared/react/guides/callbacks.md +89 -0
  121. package/docs/shared/react/guides/headless.md +31 -0
  122. package/docs/shared/react/guides/iframe-blocking.md +65 -0
  123. package/docs/shared/react/guides/internationalization.md +123 -0
  124. package/docs/shared/react/guides/network-blocker.md +72 -0
  125. package/docs/shared/react/guides/optimization.md +44 -0
  126. package/docs/shared/react/guides/policy-packs.md +173 -0
  127. package/docs/shared/react/guides/script-loader.md +311 -0
  128. package/docs/shared/react/hooks/use-color-scheme.md +31 -0
  129. package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
  130. package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
  131. package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
  132. package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
  133. package/docs/shared/react/hooks/use-draggable.md +30 -0
  134. package/docs/shared/react/hooks/use-focus-trap.md +20 -0
  135. package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
  136. package/docs/shared/react/hooks/use-ssr-status.md +16 -0
  137. package/docs/shared/react/hooks/use-text-direction.md +38 -0
  138. package/docs/shared/react/hooks/use-translations.md +15 -0
  139. package/docs/shared/react/iab/consent-banner.md +60 -0
  140. package/docs/shared/react/iab/consent-dialog.md +76 -0
  141. package/docs/shared/react/iab/overview.md +80 -0
  142. package/docs/shared/react/iab/use-gvl-data.md +21 -0
  143. package/docs/shared/react/styling/classnames.md +93 -0
  144. package/docs/shared/react/styling/color-scheme.md +35 -0
  145. package/docs/shared/react/styling/css-variables.md +53 -0
  146. package/docs/shared/react/styling/overview.md +261 -0
  147. package/docs/shared/react/styling/slots.md +93 -0
  148. package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
  149. package/docs/shared/react/styling/tailwind.md +88 -0
  150. package/docs/shared/react/styling/tokens.md +155 -0
  151. package/docs/shared/troubleshooting.md +82 -0
  152. package/package.json +19 -10
  153. package/readme.json +14 -8
  154. package/docs/ai-agents.md +0 -111
  155. package/docs/components/consent-dialog-trigger.md +0 -103
  156. package/docs/components/consent-manager-provider.md +0 -425
  157. package/docs/hooks/use-consent-manager/overview.md +0 -420
  158. package/docs/hooks/use-translations.md +0 -118
  159. package/docs/styling/css-variables.md +0 -92
  160. package/docs/styling/overview.md +0 -457
  161. package/docs/styling/slots.md +0 -128
  162. package/docs/styling/tokens.md +0 -216
@@ -0,0 +1,185 @@
1
+ ---
2
+ title: useConsentManager
3
+ description: The primary hook for accessing consent state and actions. Returns
4
+ the full consent store including all state properties and action methods.
5
+ group: frameworks
6
+ ---
7
+ `useConsentManager()` is the primary hook for interacting with the consent system. It returns the complete consent store state and all action methods.
8
+
9
+ ```tsx
10
+ import { useConsentManager } from '@c15t/nextjs';
11
+
12
+ function MyComponent() {
13
+ const {
14
+ consents,
15
+ model,
16
+ has,
17
+ saveConsents,
18
+ // ... all state and actions
19
+ } = useConsentManager();
20
+ }
21
+ ```
22
+
23
+ > ⚠️ **Warning:**
24
+ > Must be used within a ConsentManagerProvider. Throws an error if used outside the provider.
25
+
26
+ ## State Properties
27
+
28
+ |Property|Value|
29
+ |:--|:--|
30
+ |Type Name|\`StoreRuntimeState\`|
31
+ |Source Path|\`./packages/core/src/store/type.ts\`|
32
+
33
+ \*ExtractedTypeTable: Could not extract "StoreRuntimeState" from "./packages/core/src/store/type.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
34
+
35
+ ## Action Methods
36
+
37
+ |Property|Value|
38
+ |:--|:--|
39
+ |Type Name|\`StoreActions\`|
40
+ |Source Path|\`./packages/core/src/store/type.ts\`|
41
+
42
+ \*ExtractedTypeTable: Could not extract "StoreActions" from "./packages/core/src/store/type.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
43
+
44
+ ## User Identification
45
+
46
+ You can link a consent subject to your own internal user ID or a non-secret anonymous visitor ID. c15t stores the identifier in the subject row's `externalId` field. Consent records remain associated with that subject through `subjectId`, so your backend can find the subject and its related consent records by external ID for GDPR Article 15 exports.
47
+
48
+ ### 1. Providing the Current User ID
49
+
50
+ When using Clerk, prefer the Clerk `userId` whenever the visitor is signed in. Before sign-in, you can fall back to a non-secret visitor ID stored in a first-party cookie:
51
+
52
+ > ⚠️ **Warning:**
53
+ > ConsentManagerProvider runs on the client. Values passed through options.user are therefore available to client-side JavaScript, even when they were read from an HttpOnly cookie on the server. Pass only a non-secret identifier, such as a Clerk userId or an opaque visitor ID. Never pass a Clerk session token or a value returned by getToken().
54
+ >
55
+ > ℹ️ **Info:**
56
+ > Clerk's auth() helper requires clerkMiddleware() to be configured. This example also uses the asynchronous cookies() API from Next.js 15+. For Next.js 14 and earlier, use const cookieStore = cookies(); without await. Keep the layout asynchronous because Clerk's auth() is asynchronous.
57
+
58
+ ```tsx
59
+ // app/layout.tsx
60
+ import { ClerkProvider } from '@clerk/nextjs';
61
+ import { auth } from '@clerk/nextjs/server';
62
+ import { ConsentManagerProvider } from '@c15t/nextjs';
63
+ import { cookies } from 'next/headers';
64
+ import { ClerkConsentSync } from './clerk-consent-sync';
65
+
66
+ export default async function RootLayout({ children }: { children: React.ReactNode }) {
67
+ const { userId } = await auth();
68
+ const cookieStore = await cookies();
69
+ const visitorId = cookieStore.get('consent_visitor_id')?.value;
70
+ const consentUser = userId
71
+ ? { id: userId, identityProvider: 'clerk' }
72
+ : visitorId
73
+ ? { id: visitorId, identityProvider: 'anonymous-visitor' }
74
+ : undefined;
75
+
76
+ return (
77
+ <html lang="en">
78
+ <body>
79
+ <ClerkProvider>
80
+ <ConsentManagerProvider
81
+ options={{
82
+ mode: 'hosted',
83
+ backendURL: '/api/c15t',
84
+ consentCategories: ['necessary', 'measurement', 'marketing'],
85
+ user: consentUser,
86
+ }}
87
+ >
88
+ <ClerkConsentSync />
89
+ {children}
90
+ </ConsentManagerProvider>
91
+ </ClerkProvider>
92
+ </body>
93
+ </html>
94
+ );
95
+ }
96
+ ```
97
+
98
+ ### 2. Synchronizing Clerk Sign-ins
99
+
100
+ Clerk can complete a sign-in without reloading the page. Add a client component inside `ConsentManagerProvider` to update the current consent subject as soon as Clerk exposes the authenticated `userId`:
101
+
102
+ ```tsx
103
+ // app/clerk-consent-sync.tsx
104
+ 'use client';
105
+
106
+ import { useAuth } from '@clerk/nextjs';
107
+ import { useConsentManager } from '@c15t/nextjs';
108
+ import { useEffect } from 'react';
109
+
110
+ export function ClerkConsentSync() {
111
+ const { isLoaded, isSignedIn, userId } = useAuth();
112
+ const { identifyUser } = useConsentManager();
113
+
114
+ useEffect(() => {
115
+ if (!isLoaded || !isSignedIn || !userId) {
116
+ return;
117
+ }
118
+
119
+ void identifyUser({
120
+ id: userId,
121
+ identityProvider: 'clerk',
122
+ }).then(() => {
123
+ // Prevent the old anonymous ID from replacing the Clerk ID after sign-out.
124
+ document.cookie =
125
+ 'consent_visitor_id=; Max-Age=0; Path=/; SameSite=Lax';
126
+ });
127
+ }, [identifyUser, isLoaded, isSignedIn, userId]);
128
+
129
+ return null;
130
+ }
131
+ ```
132
+
133
+ `identifyUser()` replaces the subject's current `externalId`; it does not retain the anonymous ID as an alias. Once a visitor is linked to Clerk, stop supplying the former visitor ID. The example clears its client-readable cookie only after `identifyUser()` succeeds so a later render cannot change the subject back to the anonymous ID.
134
+
135
+ > ℹ️ **Info:**
136
+ > Backend subject identification requires hosted mode (mode: 'hosted'). In offline mode, identifyUser() cannot update a backend subject. Identifiers supplied through options.user can still be held in client state and persisted with locally stored consent, so do not place sensitive values there.
137
+
138
+ ## Key Types
139
+
140
+ ### ConsentState
141
+
142
+ A record mapping consent category names to their boolean values:
143
+
144
+ ```ts
145
+ type ConsentState = Record<AllConsentNames, boolean>;
146
+ // Example: { necessary: true, measurement: true, marketing: false }
147
+ ```
148
+
149
+ ### ConsentInfo
150
+
151
+ Metadata about when and how consent was recorded:
152
+
153
+ ```ts
154
+ interface ConsentInfo {
155
+ time: number; // Epoch timestamp when consent was recorded
156
+ subjectId?: string; // Client-generated subject ID (sub_xxx format)
157
+ externalId?: string; // External user ID linked via identifyUser()
158
+ identityProvider?: string; // Identity provider (e.g. 'clerk', 'auth0')
159
+ }
160
+ ```
161
+
162
+ ### LocationInfo
163
+
164
+ Detected geographic location from the c15t backend:
165
+
166
+ ```ts
167
+ interface LocationInfo {
168
+ countryCode: string; // ISO 3166-1 alpha-2 (e.g. 'DE')
169
+ regionCode: string; // Region/state code (e.g. 'BY')
170
+ jurisdiction: string; // Applicable jurisdiction (e.g. 'GDPR', 'CCPA')
171
+ }
172
+ ```
173
+
174
+ ### Model
175
+
176
+ The active consent model:
177
+
178
+ ```ts
179
+ type Model = 'opt-in' | 'opt-out' | 'iab' | null;
180
+ ```
181
+
182
+ * `'opt-in'` — Explicit consent required before tracking (GDPR)
183
+ * `'opt-out'` — Tracking allowed by default, user can opt out (CCPA)
184
+ * `'iab'` — IAB TCF 2.3 compliance mode
185
+ * `null` — No jurisdiction detected yet
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Setting Consent
3
- description: Save, update, and reset consent preferences with setConsent(), setSelectedConsent(), and saveConsents().
3
+ description: Save, update, and reset consent preferences with setConsent(),
4
+ setSelectedConsent(), and saveConsents().
5
+ group: frameworks
4
6
  ---
5
7
  ## saveConsents(type)
6
8
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: useDraggable
3
- description: Make an element draggable between viewport corners with snapping, persistence, and animation support.
3
+ description: Make an element draggable between viewport corners with snapping,
4
+ persistence, and animation support.
5
+ group: frameworks
4
6
  ---
5
7
  `useDraggable()` provides drag-to-corner functionality. Used internally by `ConsentDialogTrigger`, this hook lets you build custom draggable elements that snap to viewport corners.
6
8
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: useFocusTrap
3
3
  description: Trap keyboard focus within a container for accessible modal dialogs.
4
+ group: frameworks
4
5
  ---
5
6
  `useFocusTrap()` keeps keyboard focus within a container element while active. This is essential for accessibility - when a modal dialog is open, Tab and Shift+Tab should cycle through focusable elements inside the dialog, not escape to the page behind it.
6
7
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: useReducedMotion
3
- description: Detect the user's prefers-reduced-motion OS setting and reactively disable animations.
3
+ description: Detect the user's prefers-reduced-motion OS setting and reactively
4
+ disable animations.
5
+ group: frameworks
4
6
  ---
5
7
  `useReducedMotion()` reads the `prefers-reduced-motion: reduce` media query and reactively updates when the user's preference changes. Use it to conditionally skip animations for users who have enabled reduced motion in their OS accessibility settings.
6
8
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: useSSRStatus
3
3
  description: Check whether server-side rendered consent data was used during initialization.
4
+ group: frameworks
4
5
  ---
5
6
  `useSSRStatus()` returns information about whether SSR data was used for consent manager initialization. This is primarily useful for debugging SSR data flow in Next.js or other server-rendering frameworks.
6
7
 
@@ -20,12 +21,12 @@ function DebugSSR() {
20
21
 
21
22
  ## Return Value
22
23
 
23
- ### SSRStatus
24
+ |Property|Value|
25
+ |:--|:--|
26
+ |Type Name|\`SSRStatus\`|
27
+ |Source Path|\`./packages/react/src/hooks/use-ssr-status.ts\`|
24
28
 
25
- |Property|Type|Description|Default|Required|
26
- |:--|:--|:--|:--|:--:|
27
- |ssrDataUsed|boolean|Whether SSR data was used for initialization. \`true\` if SSR data was provided and successfully consumed, \`false\` otherwise.|-|✅ Required|
28
- |ssrSkippedReason|"no\_data" \|"fetch\_failed" \|"context\_mismatch" \|null|Reason SSR data was skipped, or \`null\` if used successfully.|-|✅ Required|
29
+ \*ExtractedTypeTable: Could not extract "SSRStatus" from "./packages/react/src/hooks/use-ssr-status.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
29
30
 
30
31
  > ℹ️ **Info:**
31
32
  > Must be used within a ConsentManagerProvider. Throws if used outside the provider context.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  title: useTextDirection
3
3
  description: Manage RTL/LTR text direction based on the active language for consent UI.
4
+ group: frameworks
4
5
  ---
5
6
  `useTextDirection()` determines the correct text direction (`'ltr'` or `'rtl'`) based on the provided language and sets it on the document. It wraps the `@c15t/ui` text direction utilities as a React hook.
6
7
 
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: useTranslations
3
+ description: Access the current language's translations for building custom consent UI.
4
+ group: frameworks
5
+ ---
6
+ `useTranslations()` returns the `Translations` object for the currently active language. Use it when building custom consent UI that needs translated text.
7
+
8
+ ```tsx
9
+ import { useTranslations } from '@c15t/nextjs';
10
+
11
+ function CustomBanner() {
12
+ const translations = useTranslations();
13
+
14
+ return (
15
+ <div>
16
+ <h2>{translations.cookieBanner.title}</h2>
17
+ <p>{translations.cookieBanner.description}</p>
18
+ <button>{translations.common.acceptAll}</button>
19
+ <button>{translations.common.rejectAll}</button>
20
+ </div>
21
+ );
22
+ }
23
+ ```
24
+
25
+ ## Translation Sections
26
+
27
+ The returned `Translations` object has these sections:
28
+
29
+ |Property|Value|
30
+ |:--|:--|
31
+ |Type Name|\`Translations\`|
32
+ |Source Path|\`./packages/translations/src/types.ts\`|
33
+
34
+ \*ExtractedTypeTable: Could not extract "Translations" from "./packages/translations/src/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
35
+
36
+ ## With setLanguage
37
+
38
+ Translations update automatically when the language changes:
39
+
40
+ ```tsx
41
+ import { useConsentManager, useTranslations } from '@c15t/nextjs';
42
+
43
+ function LocalizedConsent() {
44
+ const { setLanguage } = useConsentManager();
45
+ const translations = useTranslations();
46
+
47
+ return (
48
+ <div>
49
+ <p>{translations.cookieBanner.description}</p>
50
+ <button onClick={() => setLanguage('de')}>Deutsch</button>
51
+ <button onClick={() => setLanguage('fr')}>Français</button>
52
+ </div>
53
+ );
54
+ }
55
+ ```
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: IABConsentBanner
3
- description: An IAB TCF 2.3 compliant consent banner that displays partner count, purpose summaries, and legitimate interest notices.
3
+ description: An IAB TCF 2.3 compliant consent banner that displays partner
4
+ count, purpose summaries, and legitimate interest notices.
5
+ group: frameworks
4
6
  ---
5
7
  > ℹ️ **Info:**
6
8
  > c15t's IAB TCF support can be used in production. Use Inth for a hosted, IAB TCF-certified CMP setup with a managed CMP ID, or register your own CMP with IAB Europe and configure your own CMP ID.
@@ -81,14 +83,9 @@ Options: `'reject'`, `'accept'`, `'customize'` (default: `'customize'`)
81
83
 
82
84
  ## Props
83
85
 
84
- ### IABConsentBannerProps
85
-
86
- |Property|Type|Description|Default|Required|
87
- |:--|:--|:--|:--|:--:|
88
- |noStyle|boolean \|undefined|When true, removes all default styling from the component.|false|Optional|
89
- |disableAnimation|boolean \|undefined|When true, disables entrance/exit animations.|false|Optional|
90
- |scrollLock|boolean \|undefined|When true, locks page scroll when the banner is visible.|true|Optional|
91
- |trapFocus|boolean \|undefined|When true, traps keyboard focus within the banner.|true|Optional|
92
- |primaryButton|"reject" \|"accept" \|"customize" \|undefined|Specifies which button should be highlighted as primary.|'customize'|Optional|
93
- |models|Model \|undefined|Which consent models this banner responds to.|\['iab']|Optional|
94
- |uiSource|string \|undefined|Override the UI source identifier sent with consent API calls.|'iab\_banner'|Optional|
86
+ |Property|Value|
87
+ |:--|:--|
88
+ |Type Name|\`IABConsentBannerProps\`|
89
+ |Source Path|\`./packages/react/src/components/iab-consent-banner/iab-consent-banner.tsx\`|
90
+
91
+ \*ExtractedTypeTable: Could not extract "IABConsentBannerProps" from "./packages/react/src/components/iab-consent-banner/iab-consent-banner.tsx" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: IABConsentDialog
3
- description: An IAB TCF 2.3 compliant preference center with tabbed purpose and vendor management.
3
+ description: An IAB TCF 2.3 compliant preference center with tabbed purpose and
4
+ vendor management.
5
+ group: frameworks
4
6
  ---
5
7
  > ℹ️ **Info:**
6
8
  > c15t's IAB TCF support can be used in production. Use Inth for a hosted, IAB TCF-certified CMP setup with a managed CMP ID, or register your own CMP with IAB Europe and configure your own CMP ID.
@@ -119,16 +121,9 @@ The dialog footer provides three buttons:
119
121
 
120
122
  ## Props
121
123
 
122
- ### IABConsentDialogProps
123
-
124
- |Property|Type|Description|Default|Required|
125
- |:--|:--|:--|:--|:--:|
126
- |open|boolean \|undefined|Control the open state. If omitted, follows activeUI === 'dialog' from context.|-|Optional|
127
- |noStyle|boolean \|undefined|When true, removes all default styling.|false|Optional|
128
- |disableAnimation|boolean \|undefined|When true, disables entrance/exit animations.|false|Optional|
129
- |scrollLock|boolean \|undefined|When true, locks page scroll when the dialog is visible.|true|Optional|
130
- |trapFocus|boolean \|undefined|When true, traps keyboard focus within the dialog.|true|Optional|
131
- |hideBranding|boolean \|undefined|When true, hides the branding in the footer.|false|Optional|
132
- |showTrigger|ConsentDialogTriggerProps \|undefined|Show a floating trigger button to resurface the consent dialog. IAB TCF requires the consent dialog to be easily resurfaceable. Options: \`true\` - Show trigger with default settings; \`false\` - Hide trigger (default); \`ConsentDialogTriggerProps\` - Show trigger with custom props|false|Optional|
133
- |models|Model \|undefined|Which consent models this dialog responds to.|\['iab']|Optional|
134
- |uiSource|string \|undefined|Override the UI source identifier sent with consent API calls.|'iab\_dialog'|Optional|
124
+ |Property|Value|
125
+ |:--|:--|
126
+ |Type Name|\`IABConsentDialogProps\`|
127
+ |Source Path|\`./packages/react/src/components/iab-consent-dialog/iab-consent-dialog.tsx\`|
128
+
129
+ \*ExtractedTypeTable: Could not extract "IABConsentDialogProps" from "./packages/react/src/components/iab-consent-dialog/iab-consent-dialog.tsx" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: IAB TCF 2.3
3
- description: Implement IAB Transparency & Consent Framework 2.3 compliance for programmatic advertising in EU/EEA jurisdictions.
3
+ description: Implement IAB Transparency & Consent Framework 2.3 compliance for
4
+ programmatic advertising in EU/EEA jurisdictions.
5
+ group: frameworks
4
6
  ---
5
7
  ## What is IAB TCF?
6
8
 
@@ -19,7 +21,7 @@ When your site participates in the IAB ecosystem (ad exchanges, SSPs, DSPs, DMPs
19
21
 
20
22
  If you self-host the c15t backend or want to operate as your own CMP, register your own CMP with IAB Europe and configure your CMP ID on the backend via `advanced.iab.cmpId` or on the client via the `iab.cmpId` option. Registering your own CMP may also involve IAB Europe fees, so check IAB Europe's current CMP registration terms and pricing before choosing this route. A valid (non-zero) CMP ID is required for IAB TCF compliance.
21
23
 
22
- > ℹ️ **Info:**
24
+ > ⚠️ **Warning:**
23
25
  > If you heavily customize or build your own IAB banner or dialog instead of using the default IABConsentBanner and IABConsentDialog components, you cannot use Inth's CMP ID. You must register your own CMP with IAB Europe and use your own CMP ID.
24
26
 
25
27
  ## How c15t Implements TCF
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  title: useGVLData (Internal)
3
3
  description: Status note for the internal GVL hook used by the built-in IAB dialog.
4
+ group: frameworks
4
5
  ---
5
- > ℹ️ **Info:**
6
+ > ⚠️ **Warning:**
6
7
  > c15t's IAB TCF support can be used in production through Inth or with your own registered CMP ID. useGVLData() is different: it remains an internal hook and is not part of the supported public API.
7
8
 
8
9
  `useGVLData()` currently powers the built-in `IABConsentDialog`, but it is **not part of the public package surface**.
@@ -14,7 +15,7 @@ If you need supported customization points today:
14
15
  * Use `IABConsentBanner` and `IABConsentDialog` from `@c15t/react/iab` for the supported prebuilt UI
15
16
  * Use `useHeadlessIABConsentUI()` from `@c15t/react/iab` when you need lower-level control over banner/dialog state and actions
16
17
 
17
- > ℹ️ **Info:**
18
+ > ⚠️ **Warning:**
18
19
  > Until useGVLData() is exported as public API, avoid importing it from deep internal paths. Those paths are not covered by semver guarantees and can change without notice.
19
20
 
20
21
  When a public GVL-focused hook becomes part of the supported API, this page should document that public surface instead of the internal dialog hook.
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Iframe Blocking
3
- description: Block embedded content (YouTube, social widgets, maps) until users grant consent for the appropriate category.
3
+ description: Block embedded content (YouTube, social widgets, maps) until users
4
+ grant consent for the appropriate category.
5
+ group: frameworks
4
6
  ---
5
7
  Embedded iframes from third parties (YouTube, Google Maps, social media widgets) can set cookies and track users without their consent. c15t provides two approaches to gate iframes behind consent:
6
8
 
@@ -96,12 +98,9 @@ function IframeBlockerInit() {
96
98
 
97
99
  ## API Reference
98
100
 
99
- ### FrameProps
101
+ |Property|Value|
102
+ |:--|:--|
103
+ |Type Name|\`FrameProps\`|
104
+ |Source Path|\`./packages/react/src/components/frame/types.ts\`|
100
105
 
101
- |Property|Type|Description|Default|Required|
102
- |:--|:--|:--|:--|:--:|
103
- |children|ReactNode|Content rendered when consent is granted. Children are not mounted until consent is given, preventing unnecessary network requests.|-|✅ Required|
104
- |category|AllConsentNames|Consent category required to render children.|-|✅ Required|
105
- |placeholder|ReactNode|A custom placeholder component to display when consent is not met. If not provided, a default placeholder will be displayed.|-|Optional|
106
- |noStyle|boolean \|undefined|When true, removes all default styling from the component|false|Optional|
107
- |theme|any|Custom theme to override default styles while maintaining structure and accessibility. Merges with defaults. Ignored when \`noStyle=\{true}\`.|undefined|Optional|
106
+ \*ExtractedTypeTable: Could not extract "FrameProps" from "./packages/react/src/components/frame/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Internationalization
3
- description: Translate consent UI into 30+ languages with built-in translations, custom overrides, and automatic browser language detection.
3
+ description: Translate consent UI into 30+ languages with built-in translations,
4
+ custom overrides, and automatic browser language detection.
5
+ group: frameworks
4
6
  ---
5
7
  c15t ships with built-in translations for 30+ languages via the `@c15t/translations` package. Language detection happens automatically based on the browser's language preference, and you can override or extend translations for any language.
6
8
 
@@ -83,7 +85,7 @@ The `Translations` object is organized into sections:
83
85
  |`cookieBanner`|Banner title and description|
84
86
  |`consentManagerDialog`|Dialog title and description|
85
87
  |`consentTypes`|Per-category title and description (keyed by AllConsentNames)|
86
- |`frame`|Frame placeholder title and button text (supports `{category}` placeholder)|
88
+ |`frame`|Frame placeholder title, button, loading, and error text (title and button support `{category}`)|
87
89
  |`legalLinks`|Privacy policy, cookie policy, terms of service link text|
88
90
  |`iab`|IAB TCF banner, preference center, vendor list translations|
89
91
 
@@ -153,7 +155,9 @@ If you need a policy to always use one specific language regardless of browser p
153
155
 
154
156
  ## Custom Consent Type Labels
155
157
 
156
- Override the title and description for individual consent categories:
158
+ Override the title and description for individual consent categories. Frame
159
+ placeholders use that title anywhere their message contains `{category}`, so
160
+ the title and action stay consistent:
157
161
 
158
162
  ```tsx
159
163
  i18n: {
@@ -169,6 +173,12 @@ i18n: {
169
173
  description: 'Used to deliver relevant ads and measure campaign effectiveness.',
170
174
  },
171
175
  },
176
+ frame: {
177
+ title: 'Allow {category} consent to view this content.',
178
+ actionButton: 'Enable {category} consent',
179
+ loading: 'Loading content…',
180
+ error: 'This content could not be loaded.',
181
+ },
172
182
  },
173
183
  },
174
184
  }
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Network Blocker
3
- description: Block outgoing network requests to third-party domains until the user grants consent for the appropriate category.
3
+ description: Block outgoing network requests to third-party domains until the
4
+ user grants consent for the appropriate category.
5
+ group: frameworks
4
6
  ---
5
7
  The network blocker intercepts outgoing `fetch` and `XMLHttpRequest` calls and blocks them based on consent state and domain rules. This catches tracking requests that happen outside of script loading - for example, beacon calls, API requests to analytics endpoints, or pixel fires from already-loaded scripts.
6
8
 
@@ -123,56 +125,16 @@ function NetworkBlockerManager() {
123
125
 
124
126
  ## API Reference
125
127
 
126
- ### NetworkBlockerRule
128
+ |Property|Value|
129
+ |:--|:--|
130
+ |Type Name|\`NetworkBlockerRule\`|
131
+ |Source Path|\`./packages/core/src/libs/network-blocker/types.ts\`|
127
132
 
128
- |Property|Type|Description|Default|Required|
129
- |:--|:--|:--|:--|:--:|
130
- |id|string \|undefined|Optional identifier for the rule. Useful for debugging and logging.|-|Optional|
131
- |domain|string|Domain that this rule applies to.|-|✅ Required|
132
- |pathIncludes|string \|undefined|Optional path substring that must be present in the request path for the rule to apply.|-|Optional|
133
- |methods|string\[] \|undefined|Optional list of HTTP methods that this rule applies to. If omitted, the rule applies to all methods.|-|Optional|
134
- |category|HasCondition\<AllConsentNames>|Consent condition that must be satisfied to allow the request. When this condition is not satisfied, matching requests will be blocked.|-|✅ Required|
133
+ \*ExtractedTypeTable: Could not extract "NetworkBlockerRule" from "./packages/core/src/libs/network-blocker/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
135
134
 
136
- ### NetworkBlockerConfig
135
+ |Property|Value|
136
+ |:--|:--|
137
+ |Type Name|\`NetworkBlockerConfig\`|
138
+ |Source Path|\`./packages/core/src/libs/network-blocker/types.ts\`|
137
139
 
138
- |Property|Type|Description|Default|Required|
139
- |:--|:--|:--|:--|:--:|
140
- |enabled|boolean \|undefined|Whether the network blocker is enabled.|-|Optional|
141
- |initialConsents|ConsentState \|undefined|The consent state snapshot that is currently used for blocking logic.|-|Optional|
142
- |logBlockedRequests|boolean \|undefined|Whether to automatically log blocked requests to the console.|-|Optional|
143
- |onRequestBlocked|Object \|undefined|Callback invoked whenever a request is blocked.|-|Optional|
144
- |rules|NetworkBlockerRule|Domain rules that determine which requests should be blocked.|-|✅ Required|
145
-
146
- #### `initialConsents` ConsentState
147
-
148
- The consent state snapshot that is currently used for blocking logic.
149
-
150
- |Property|Type|Description|Default|Required|
151
- |:--|:--|:--|:--|:--:|
152
- |experience|boolean|-|-|✅ Required|
153
- |functionality|boolean|-|-|✅ Required|
154
- |marketing|boolean|-|-|✅ Required|
155
- |measurement|boolean|-|-|✅ Required|
156
- |necessary|boolean|-|-|✅ Required|
157
-
158
- #### `onRequestBlocked`
159
-
160
- Callback invoked whenever a request is blocked.
161
-
162
- |Property|Type|Description|Default|Required|
163
- |:--|:--|:--|:--|:--:|
164
- |method|string|The HTTP method of the blocked request (e.g. GET, POST).|-|✅ Required|
165
- |url|string|The URL of the blocked request.|-|✅ Required|
166
- |rule|NetworkBlockerRule \|undefined|The rule that caused the request to be blocked, if available. Can be undefined when the blocker configuration changed between evaluation and logging.|-|Optional|
167
-
168
- #### `rules` NetworkBlockerRule
169
-
170
- Domain rules that determine which requests should be blocked.
171
-
172
- |Property|Type|Description|Default|Required|
173
- |:--|:--|:--|:--|:--:|
174
- |id|string \|undefined|Optional identifier for the rule. Useful for debugging and logging.|-|Optional|
175
- |domain|string|Domain that this rule applies to.|-|✅ Required|
176
- |pathIncludes|string \|undefined|Optional path substring that must be present in the request path for the rule to apply.|-|Optional|
177
- |methods|string\[] \|undefined|Optional list of HTTP methods that this rule applies to. If omitted, the rule applies to all methods.|-|Optional|
178
- |category|HasCondition\<AllConsentNames>|Consent condition that must be satisfied to allow the request. When this condition is not satisfied, matching requests will be blocked.|-|✅ Required|
140
+ \*ExtractedTypeTable: Could not extract "NetworkBlockerConfig" from "./packages/core/src/libs/network-blocker/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  title: Optimization
3
- description: Improve c15t startup performance in Next.js with same-origin rewrites, static prefetching, and dynamic-route SSR.
4
- lastModified: 2026-04-14
3
+ description: Improve c15t startup performance in Next.js with same-origin
4
+ rewrites, static prefetching, and dynamic-route SSR.
5
+ group: frameworks
5
6
  ---
6
7
  Use this guide when you care about banner visibility speed, route static-ness, and reducing backend round-trip cost.
7
8
 
@@ -66,7 +67,7 @@ Why this helps:
66
67
  > ℹ️ **Info:**
67
68
  > Set NEXT\_PUBLIC\_C15T\_URL in .env to your backend URL, for example https\://your-project.inth.app.
68
69
  >
69
- > ℹ️ **Info:**
70
+ > ⚠️ **Warning:**
70
71
  > Use rewrites for browser-side calls (ConsentManagerProvider, C15tPrefetch). For server-side fetchInitialData(), prefer a direct backend URL (for example https\://your-project.inth.app) to avoid an extra server proxy hop.
71
72
 
72
73
  ## 2) Choose A Startup Strategy
@@ -136,7 +137,7 @@ export default function ConsentManager({
136
137
  }
137
138
  ```
138
139
 
139
- > ℹ️ **Info:**
140
+ > ⚠️ **Warning:**
140
141
  > Do not await fetchInitialData(). Pass the unresolved Promise to the provider so Next.js can stream the route while /init runs in parallel.
141
142
  >
142
143
  > ℹ️ **Info:**
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  title: Policy Packs
3
- description: Configure regional consent policies in Next.js — hosted mode, presets, and offline fallback.
3
+ description: Configure regional consent policies in Next.js — hosted mode,
4
+ presets, and offline fallback.
5
+ group: frameworks
4
6
  ---
5
7
  Policy packs configure how c15t handles regional consent — which model (opt-in, opt-out, none), which categories, and what UI to show. The backend resolves the right policy automatically based on the visitor's location.
6
8