@c15t/react 3.0.0-alpha.8 → 3.0.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 (164) hide show
  1. package/AGENTS.md +10 -12
  2. package/README.md +41 -70
  3. package/SKILL.md +1 -1
  4. package/dist/aggregate-components.js +1 -1
  5. package/dist/components/consent-gate/atoms.js +1 -1
  6. package/dist/components/consent-gate/frame.js +2 -0
  7. package/dist/components/consent-gate/index.js +1 -1
  8. package/dist/components/iab-panel/atoms/root.js +1 -1
  9. package/dist/components/iab-panel/iab-panel.js +1 -1
  10. package/dist/components/iab-prompt/atoms/root.js +1 -1
  11. package/dist/components/iab-prompt/iab-prompt.js +1 -1
  12. package/dist/components/panel/atoms/root.js +1 -1
  13. package/dist/components/panel-trigger/atoms/root.js +1 -1
  14. package/dist/components/panel-trigger/panel-trigger.js +1 -1
  15. package/dist/components/panel-trigger/toolbar-loader.js +2 -0
  16. package/dist/components/preferences/atoms/root.js +1 -1
  17. package/dist/components/prompt/atoms/early-tap-script.js +2 -0
  18. package/dist/components/prompt/atoms/root.js +1 -1
  19. package/dist/components/prompt/prompt.js +1 -1
  20. package/dist/components/shared/dialog-sheets.js +1 -0
  21. package/dist/components/shared/first-paint-sheets.js +1 -0
  22. package/dist/components/shared/iab-dialog-sheets.js +1 -0
  23. package/dist/components/shared/iab-first-paint-sheets.js +1 -0
  24. package/dist/components/shared/primitives/button.js +1 -1
  25. package/dist/components/shared/surface-styles.js +2 -0
  26. package/dist/consent-gate.js +1 -1
  27. package/dist/context/index.js +1 -1
  28. package/dist/devtools.js +1 -1
  29. package/dist/hooks/use-iab-policy-guard.js +1 -0
  30. package/dist/iab/styles.tw3.css +2 -2
  31. package/dist/iab-context.js +1 -1
  32. package/dist/iab-dialog-deferred.js +2 -0
  33. package/dist/iab.js +1 -1
  34. package/dist/index-parts/consent-gate.js +1 -1
  35. package/dist/index-parts/core.js +1 -1
  36. package/dist/index-parts/frame.js +1 -0
  37. package/dist/index-parts/hosted.js +1 -0
  38. package/dist/index-parts/offline.js +1 -0
  39. package/dist/index-parts/presets.js +1 -0
  40. package/dist/index.js +1 -1
  41. package/dist/modes.js +1 -0
  42. package/dist/panel-link.js +1 -1
  43. package/dist/panel-trigger.js +1 -1
  44. package/dist/provider.js +1 -1
  45. package/dist/styles.tw3.css +2 -2
  46. package/dist/transports/hosted.js +1 -0
  47. package/dist/transports/manifest.js +1 -0
  48. package/dist/utils/deferred-module.js +1 -1
  49. package/dist/version.js +1 -1
  50. package/dist-types/chunk-warming.d.ts +7 -6
  51. package/dist-types/components/consent-gate/frame.d.ts +19 -0
  52. package/dist-types/components/consent-gate/index.d.ts +3 -19
  53. package/dist-types/components/iab-prompt/iab-prompt.d.ts +1 -1
  54. package/dist-types/components/panel/index.d.ts +1 -1
  55. package/dist-types/components/panel-trigger/toolbar-loader.d.ts +34 -0
  56. package/dist-types/components/preferences/index.d.ts +1 -1
  57. package/dist-types/components/prompt/atoms/early-tap-script.d.ts +17 -0
  58. package/dist-types/components/prompt/index.d.ts +1 -1
  59. package/dist-types/components/shared/dialog-sheets.d.ts +9 -0
  60. package/dist-types/components/shared/first-paint-sheets.d.ts +8 -0
  61. package/dist-types/components/shared/iab-dialog-sheets.d.ts +3 -0
  62. package/dist-types/components/shared/iab-first-paint-sheets.d.ts +3 -0
  63. package/dist-types/components/shared/surface-styles.d.ts +60 -0
  64. package/dist-types/consent-gate.d.ts +1 -1
  65. package/dist-types/context/index.d.ts +3 -3
  66. package/dist-types/context.d.ts +2 -0
  67. package/dist-types/gpp.d.ts +1 -1
  68. package/dist-types/hooks/use-iab-policy-guard.d.ts +35 -0
  69. package/dist-types/iab-dialog-deferred.d.ts +36 -0
  70. package/dist-types/iab.d.ts +3 -2
  71. package/dist-types/index-parts/consent-gate.d.ts +1 -1
  72. package/dist-types/index-parts/core.d.ts +1 -2
  73. package/dist-types/index-parts/frame.d.ts +7 -0
  74. package/dist-types/index-parts/hosted.d.ts +7 -0
  75. package/dist-types/index-parts/offline.d.ts +7 -0
  76. package/dist-types/index-parts/presets.d.ts +7 -0
  77. package/dist-types/index.d.ts +5 -1
  78. package/dist-types/modes.d.ts +26 -0
  79. package/dist-types/panel-link.d.ts +1 -1
  80. package/dist-types/panel-trigger.d.ts +1 -1
  81. package/dist-types/provider.d.ts +22 -4
  82. package/dist-types/transports/hosted.d.ts +36 -0
  83. package/dist-types/transports/manifest.d.ts +48 -0
  84. package/dist-types/ui-config-context.d.ts +4 -0
  85. package/dist-types/version.d.ts +1 -1
  86. package/docs/README.md +10 -12
  87. package/docs/concepts/choose-your-setup.md +45 -8
  88. package/docs/concepts/consent-categories.md +1 -1
  89. package/docs/concepts/consent-state.md +5 -2
  90. package/docs/concepts/data-fetching.md +100 -40
  91. package/docs/concepts/modes.md +281 -0
  92. package/docs/customization/dark-mode.md +1 -1
  93. package/docs/customization/motion.md +2 -2
  94. package/docs/customization/overview.md +3 -2
  95. package/docs/customization/recipes.md +4 -4
  96. package/docs/customization/slots.md +25 -25
  97. package/docs/customization/stylesheets.md +161 -50
  98. package/docs/customization/tailwind.md +71 -50
  99. package/docs/customization/tokens.md +42 -13
  100. package/docs/frameworks/react/components/consent-banner.md +14 -12
  101. package/docs/frameworks/react/components/consent-dialog.md +15 -13
  102. package/docs/frameworks/react/components/consent-provider.md +51 -46
  103. package/docs/frameworks/react/components.md +16 -13
  104. package/docs/frameworks/react/compose.md +3 -3
  105. package/docs/frameworks/react/content-security-policy.md +35 -12
  106. package/docs/frameworks/react/customize.md +21 -13
  107. package/docs/frameworks/react/hooks.md +2 -2
  108. package/docs/frameworks/react/iab.md +56 -6
  109. package/docs/frameworks/react/quickstart.md +65 -99
  110. package/docs/frameworks/react/rendering.md +170 -94
  111. package/docs/frameworks/react/scripts.md +19 -30
  112. package/docs/frameworks/react/troubleshooting.md +100 -32
  113. package/docs/frameworks/react/upgrade-v3.md +133 -79
  114. package/docs/frameworks/react/vendor-consent.md +19 -7
  115. package/docs/guides/banner-experiments.md +21 -8
  116. package/docs/guides/troubleshooting.md +90 -26
  117. package/docs/guides/verify-consent.md +23 -8
  118. package/docs/integrations/adobe-analytics.md +60 -64
  119. package/docs/integrations/ahrefs-analytics.md +58 -63
  120. package/docs/integrations/amplitude.md +60 -64
  121. package/docs/integrations/clearbit.md +59 -63
  122. package/docs/integrations/cloudflare-web-analytics.md +56 -60
  123. package/docs/integrations/cloudflare-zaraz.md +55 -57
  124. package/docs/integrations/crisp.md +64 -69
  125. package/docs/integrations/databuddy.md +62 -64
  126. package/docs/integrations/fathom-analytics.md +56 -60
  127. package/docs/integrations/front-chat.md +56 -60
  128. package/docs/integrations/google-maps.md +25 -13
  129. package/docs/integrations/google-tag-manager.md +153 -77
  130. package/docs/integrations/google-tag.md +134 -78
  131. package/docs/integrations/heap.md +56 -60
  132. package/docs/integrations/hightouch.md +55 -60
  133. package/docs/integrations/hotjar.md +60 -64
  134. package/docs/integrations/intercom.md +55 -60
  135. package/docs/integrations/klaviyo.md +65 -66
  136. package/docs/integrations/linkedin-insights.md +58 -63
  137. package/docs/integrations/logrocket.md +55 -60
  138. package/docs/integrations/matomo-analytics.md +58 -60
  139. package/docs/integrations/meta-pixel.md +56 -60
  140. package/docs/integrations/microsoft-clarity.md +57 -60
  141. package/docs/integrations/microsoft-uet.md +58 -61
  142. package/docs/integrations/mixpanel-analytics.md +73 -75
  143. package/docs/integrations/one-dollar-stats.md +53 -59
  144. package/docs/integrations/openai-pixel.md +58 -60
  145. package/docs/integrations/overview.md +59 -42
  146. package/docs/integrations/pinterest-tag.md +56 -60
  147. package/docs/integrations/pirsch.md +54 -60
  148. package/docs/integrations/plausible-analytics.md +55 -60
  149. package/docs/integrations/posthog.md +56 -60
  150. package/docs/integrations/promptwatch.md +57 -63
  151. package/docs/integrations/reddit-pixel.md +57 -60
  152. package/docs/integrations/rudderstack.md +65 -67
  153. package/docs/integrations/rybbit-analytics.md +70 -75
  154. package/docs/integrations/segment.md +56 -60
  155. package/docs/integrations/sentry.md +65 -60
  156. package/docs/integrations/snapchat-pixel.md +54 -60
  157. package/docs/integrations/tiktok-pixel.md +59 -63
  158. package/docs/integrations/umami-analytics.md +54 -60
  159. package/docs/integrations/vercel-analytics.md +53 -59
  160. package/docs/integrations/vercel-speed-insights.md +317 -0
  161. package/docs/integrations/x-pixel.md +57 -63
  162. package/docs/integrations/youtube.md +25 -13
  163. package/package.json +18 -8
  164. package/docs/upgrade-v3.md +0 -429
@@ -3,22 +3,31 @@ title: LinkedIn Insight Tag
3
3
  description: Load the LinkedIn Insight Tag only after marketing consent with the
4
4
  c15t linkedinInsights helper, guard lintrk conversion calls, and check it in
5
5
  DevTools.
6
+ seoTitle: LinkedIn Insight Tag cookie consent with c15t
7
+ seoDescription: Load the LinkedIn Insight Tag only with marketing consent. The
8
+ c15t linkedinInsights helper keeps insight.min.js off the page until then.
6
9
  icon: linkedin
7
10
  group: integrations
8
11
  ---
9
12
 
13
+ The c15t `linkedinInsights` helper keeps the LinkedIn Insight Tag,
14
+ `insight.min.js`, off the page until `marketing` has consent. Until then, c15t
15
+ sets no LinkedIn globals. The helper sends no consent signal to LinkedIn. If the
16
+ visitor withdraws consent, c15t removes the script element. By default, c15t
17
+ also reloads the page.
18
+
10
19
  ## Configure the LinkedIn Insight Tag
11
20
 
12
21
  Copy the partner ID from LinkedIn Campaign Manager under Data, Signals manager,
13
22
  Insight Tag. Remove the original Insight Tag snippet and its `<noscript>`
14
23
  tracking image.
15
24
 
16
- | Package manager | Command |
17
- | :-------------- | :------------------------------------- |
18
- | npm | `npm install @c15t/integrations@alpha` |
19
- | pnpm | `pnpm add @c15t/integrations@alpha` |
20
- | yarn | `yarn add @c15t/integrations@alpha` |
21
- | bun | `bun add @c15t/integrations@alpha` |
25
+ | Package manager | Command |
26
+ | :-------------- | :------------------------------- |
27
+ | npm | `npm install @c15t/integrations` |
28
+ | pnpm | `pnpm add @c15t/integrations` |
29
+ | yarn | `yarn add @c15t/integrations` |
30
+ | bun | `bun add @c15t/integrations` |
22
31
 
23
32
  ```ts title="src/consent-scripts.ts"
24
33
  import { linkedinInsights } from '@c15t/integrations/linkedin-insights';
@@ -33,51 +42,41 @@ endpoint, policy, styles and consent UI. Remove the vendor's original script,
33
42
  SDK initializer or tag-manager entry, so the vendor loads only through c15t.
34
43
 
35
44
  The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
36
- quickstart already created a scripts file, such as `lib/scripts.ts` in the
37
- Next.js guide, add the helper to that array instead of creating a second file.
45
+ quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
46
+ in the Next.js guide, add the helper to that array instead of creating a
47
+ second file.
38
48
  The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
39
49
  point for your framework below. These are edits to that provider, not a second
40
50
  provider.
41
51
 
42
52
  **Next.js**
43
53
 
44
- Import the configuration into the client boundary from your router guide:
45
-
46
- ```ts
47
- import { ConsentRoot } from 'c15t/next';
48
- import { scripts } from './consent-scripts';
49
- ```
54
+ Add the configuration to `scripts` in `c15t.config.ts`, next to
55
+ `next.config.ts`:
50
56
 
51
- Keep the server-resolved `state` and shared `consentConfig` from your
52
- router guide. Its manifest, init and save URLs stay in effect. Add
53
- `scripts` as a top-level prop on the existing root:
57
+ ```ts title="c15t.config.ts"
58
+ import { defineConsentConfig } from 'c15t/next';
59
+ import { scripts } from './src/consent-scripts';
54
60
 
55
- ```tsx
56
- <ConsentRoot state={state} config={consentConfig} scripts={scripts}>
57
- {children}
58
- </ConsentRoot>
61
+ export default defineConsentConfig({ scripts });
59
62
  ```
60
63
 
61
- App Router, Pages Router and static export all use this `ConsentRoot` in
62
- the `'use client'` wrapper `components/consent.tsx`. Keep `scripts` there,
63
- because a Server Component cannot pass script callbacks to it. See
64
+ Keep the rest of your config, such as `mode` and `routePrefix`, in the
65
+ same call. `ConsentRoot` reads the config in the browser, so the layout
66
+ keeps passing only `state`. App Router, Pages Router and static export all
67
+ read the same file. See
64
68
  [Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
65
69
 
66
70
  **TanStack Start**
67
71
 
68
72
  Import the configuration into your root route and pass it to the existing
69
- `ConsentRoot` as a top-level prop. Keep the loader, `backendURL` and
70
- `initRoute` from the [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
73
+ `ConsentRoot` as a top-level prop. Keep the loader from the
74
+ [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
71
75
 
72
76
  ```tsx title="src/routes/__root.tsx"
73
77
  import { scripts } from '../consent-scripts';
74
78
 
75
- <ConsentRoot
76
- state={consent}
77
- backendURL={backendURL}
78
- initRoute={false}
79
- scripts={scripts}
80
- >
79
+ <ConsentRoot state={consent} scripts={scripts}>
81
80
  ```
82
81
 
83
82
  Import vendor helpers in the root route module, not in a server function.
@@ -96,8 +95,8 @@ import { scripts } from './consent-scripts';
96
95
  <ConsentProvider options={{ mode, scripts }}>
97
96
  ```
98
97
 
99
- `mode` is the `hosted({ url: 'https://your-project.inth.app' })` value
100
- from the [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
98
+ `mode` is the `manifest()` value from the
99
+ [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
101
100
  dialog and preferences link inside the provider. See
102
101
  [React scripts and embeds](../frameworks/react/scripts.md).
103
102
 
@@ -126,15 +125,16 @@ callbacks. Write the vendor IDs into `consent-scripts.ts`. See
126
125
  Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
127
126
 
128
127
  ```ts title="src/main.ts"
128
+ import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
129
129
  import { scripts } from './consent-scripts';
130
130
 
131
131
  app.use(c15tVue, {
132
- backendURL: 'https://your-project.inth.app',
132
+ mode: manifest(),
133
133
  scripts,
134
134
  });
135
135
  ```
136
136
 
137
- Keep your existing backend URL and other options. The plugin starts one
137
+ Keep your existing `mode` and other options. The plugin starts one
138
138
  script loader when the app mounts, after it has applied the visitor's stored
139
139
  choice. Do not also call `createScriptLoader` from a component. See
140
140
  [Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
@@ -142,12 +142,11 @@ choice. Do not also call `createScriptLoader` from a component. See
142
142
  **Astro**
143
143
 
144
144
  Add the scripts to the client entrypoint from the
145
- [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), the module that the
146
- integration's `clientEntrypoint` option names. Keep `mode`, `ui` and the
147
- framework integration in `astro.config.mjs` as they are. If the module
148
- already exports scripts, combine the two arrays.
145
+ [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
146
+ which the integration finds on its own. Keep `astro.config.mjs` as it is.
147
+ If the module already exports scripts, combine the two arrays.
149
148
 
150
- ```ts title="src/consent-client.ts"
149
+ ```ts title="src/c15t.client.ts"
151
150
  import type { C15tClientOptionsExtension } from 'c15t/astro';
152
151
  import { scripts } from './consent-scripts';
153
152
 
@@ -167,15 +166,13 @@ pass them as a top-level prop:
167
166
 
168
167
  ```svelte title="src/App.svelte"
169
168
  <script lang="ts">
170
- import { ConsentManagerProvider, hosted } from '@c15t/svelte';
169
+ import { ConsentProvider, manifest } from '@c15t/svelte';
171
170
  import { scripts } from './consent-scripts';
172
-
173
- const mode = hosted({ url: 'https://your-project.inth.app' });
174
171
  </script>
175
172
 
176
- <ConsentManagerProvider {mode} {scripts}>
173
+ <ConsentProvider mode={manifest()} {scripts}>
177
174
  <!-- Keep your application, consent UI and preferences link here. -->
178
- </ConsentManagerProvider>
175
+ </ConsentProvider>
179
176
  ```
180
177
 
181
178
  Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
@@ -183,22 +180,21 @@ The provider owns the loader and disposes it on unmount.
183
180
 
184
181
  **SvelteKit**
185
182
 
186
- Add the scripts to the existing root layout provider. Keep the server load
187
- and its serializable prefetch data from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
183
+ Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
184
+ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
188
185
 
189
186
  ```svelte title="src/routes/+layout.svelte"
190
187
  <script lang="ts">
191
- import { ConsentManagerProvider, hosted } from '@c15t/svelte';
188
+ import { ConsentRoot } from '@c15t/svelte';
192
189
  import { scripts } from '../consent-scripts';
193
190
 
194
191
  let { children, data } = $props();
195
- const mode = hosted({ url: 'https://your-project.inth.app' });
196
192
  </script>
197
193
 
198
- <ConsentManagerProvider {mode} {scripts} prefetch={data.prefetch}>
194
+ <ConsentRoot state={data.consent} {scripts}>
199
195
  {@render children()}
200
196
  <!-- Keep your consent UI and preferences link here. -->
201
- </ConsentManagerProvider>
197
+ </ConsentRoot>
202
198
  ```
203
199
 
204
200
  Import vendor helpers in the layout component, not in `+layout.server.ts`:
@@ -225,20 +221,19 @@ to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/sc
225
221
 
226
222
  **JavaScript**
227
223
 
228
- Pass the scripts to `init()` from `@c15t/browser`, next to your backend
229
- URL:
224
+ Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
230
225
 
231
226
  ```ts
232
- import { init } from '@c15t/browser';
227
+ import { init, manifest } from '@c15t/browser';
233
228
  import { scripts } from './consent-scripts';
234
229
 
235
230
  const consent = init({
236
- backendURL: 'https://your-project.inth.app',
231
+ mode: manifest(),
237
232
  scripts,
238
233
  });
239
234
  ```
240
235
 
241
- Keep the backend URL from your quickstart. With
236
+ Keep the mode from your quickstart. With
242
237
  `createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
243
238
  A kernel you create yourself needs a loader from
244
239
  `c15t/modules/script-loader`. Attach one loader per kernel. See
@@ -246,10 +241,10 @@ A kernel you create yourself needs a loader from
246
241
 
247
242
  ## Options
248
243
 
249
- | Option | Default | Behavior |
250
- | ----------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
251
- | `id` | Required | Partner ID. The helper trims it, sets it as `_linkedin_partner_id` and appends it to `_linkedin_data_partner_ids`. Empty or whitespace-only values throw. |
252
- | `scriptSrc` | `https://snap.licdn.com/li.lms-analytics/insight.min.js` | Loader URL override. A blank value falls back to the default. |
244
+ | Option | Default | Behavior |
245
+ | ----------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
246
+ | `id` | Required | Partner ID. The helper trims it, sets it as `_linkedin_partner_id` and appends it to `_linkedin_data_partner_ids`. Empty or whitespace-only values log an error and the script does not load. |
247
+ | `scriptSrc` | `https://snap.licdn.com/li.lms-analytics/insight.min.js` | Loader URL override. A blank value falls back to the default. |
253
248
 
254
249
  ## Loading and revocation
255
250
 
@@ -308,8 +303,8 @@ permission before each of your own event calls. The reload does not delete
308
303
  cookies the vendor already set; see
309
304
  [clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
310
305
 
311
- The helper sets `vendor` to its script ID, so once you declare that vendor a
312
- visitor can turn it off inside an allowed category. See
306
+ The helper lists its vendor by name in the preference dialog, so a visitor can
307
+ turn it off inside an allowed category. See
313
308
  [vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
314
309
  [consent verification guide](../guides/verify-consent.md) covers navigation,
315
310
  expiry and hosting checks.
@@ -2,21 +2,30 @@
2
2
  title: LogRocket
3
3
  description: Load LogRocket session replay only after measurement consent with
4
4
  the c15t logRocket helper, including proxied setups, and check it in DevTools.
5
+ seoTitle: LogRocket cookie consent with c15t
6
+ seoDescription: Record LogRocket sessions only with measurement consent. The
7
+ c15t logRocket helper stops session replay when a visitor withdraws consent.
5
8
  icon: logrocket
6
9
  group: integrations
7
10
  ---
8
11
 
12
+ The c15t `logRocket` helper keeps LogRocket session replay off the page until
13
+ `measurement` has consent. `LogRocket.init` runs only after `LogRocket.min.js`
14
+ loads. The helper sends no consent signal to LogRocket. If the visitor withdraws
15
+ consent, c15t removes the script element. By default, c15t also reloads the
16
+ page. The reload stops the session replay.
17
+
9
18
  ## Configure LogRocket
10
19
 
11
20
  Copy the app ID from LogRocket Project Setup. It has the form
12
21
  `org-slug/app-slug`. Remove the original LogRocket install.
13
22
 
14
- | Package manager | Command |
15
- | :-------------- | :------------------------------------- |
16
- | npm | `npm install @c15t/integrations@alpha` |
17
- | pnpm | `pnpm add @c15t/integrations@alpha` |
18
- | yarn | `yarn add @c15t/integrations@alpha` |
19
- | bun | `bun add @c15t/integrations@alpha` |
23
+ | Package manager | Command |
24
+ | :-------------- | :------------------------------- |
25
+ | npm | `npm install @c15t/integrations` |
26
+ | pnpm | `pnpm add @c15t/integrations` |
27
+ | yarn | `yarn add @c15t/integrations` |
28
+ | bun | `bun add @c15t/integrations` |
20
29
 
21
30
  ```ts title="src/consent-scripts.ts"
22
31
  import { logRocket } from '@c15t/integrations/logrocket';
@@ -31,51 +40,41 @@ endpoint, policy, styles and consent UI. Remove the vendor's original script,
31
40
  SDK initializer or tag-manager entry, so the vendor loads only through c15t.
32
41
 
33
42
  The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
34
- quickstart already created a scripts file, such as `lib/scripts.ts` in the
35
- Next.js guide, add the helper to that array instead of creating a second file.
43
+ quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
44
+ in the Next.js guide, add the helper to that array instead of creating a
45
+ second file.
36
46
  The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
37
47
  point for your framework below. These are edits to that provider, not a second
38
48
  provider.
39
49
 
40
50
  **Next.js**
41
51
 
42
- Import the configuration into the client boundary from your router guide:
43
-
44
- ```ts
45
- import { ConsentRoot } from 'c15t/next';
46
- import { scripts } from './consent-scripts';
47
- ```
52
+ Add the configuration to `scripts` in `c15t.config.ts`, next to
53
+ `next.config.ts`:
48
54
 
49
- Keep the server-resolved `state` and shared `consentConfig` from your
50
- router guide. Its manifest, init and save URLs stay in effect. Add
51
- `scripts` as a top-level prop on the existing root:
55
+ ```ts title="c15t.config.ts"
56
+ import { defineConsentConfig } from 'c15t/next';
57
+ import { scripts } from './src/consent-scripts';
52
58
 
53
- ```tsx
54
- <ConsentRoot state={state} config={consentConfig} scripts={scripts}>
55
- {children}
56
- </ConsentRoot>
59
+ export default defineConsentConfig({ scripts });
57
60
  ```
58
61
 
59
- App Router, Pages Router and static export all use this `ConsentRoot` in
60
- the `'use client'` wrapper `components/consent.tsx`. Keep `scripts` there,
61
- because a Server Component cannot pass script callbacks to it. See
62
+ Keep the rest of your config, such as `mode` and `routePrefix`, in the
63
+ same call. `ConsentRoot` reads the config in the browser, so the layout
64
+ keeps passing only `state`. App Router, Pages Router and static export all
65
+ read the same file. See
62
66
  [Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
63
67
 
64
68
  **TanStack Start**
65
69
 
66
70
  Import the configuration into your root route and pass it to the existing
67
- `ConsentRoot` as a top-level prop. Keep the loader, `backendURL` and
68
- `initRoute` from the [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
71
+ `ConsentRoot` as a top-level prop. Keep the loader from the
72
+ [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
69
73
 
70
74
  ```tsx title="src/routes/__root.tsx"
71
75
  import { scripts } from '../consent-scripts';
72
76
 
73
- <ConsentRoot
74
- state={consent}
75
- backendURL={backendURL}
76
- initRoute={false}
77
- scripts={scripts}
78
- >
77
+ <ConsentRoot state={consent} scripts={scripts}>
79
78
  ```
80
79
 
81
80
  Import vendor helpers in the root route module, not in a server function.
@@ -94,8 +93,8 @@ import { scripts } from './consent-scripts';
94
93
  <ConsentProvider options={{ mode, scripts }}>
95
94
  ```
96
95
 
97
- `mode` is the `hosted({ url: 'https://your-project.inth.app' })` value
98
- from the [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
96
+ `mode` is the `manifest()` value from the
97
+ [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
99
98
  dialog and preferences link inside the provider. See
100
99
  [React scripts and embeds](../frameworks/react/scripts.md).
101
100
 
@@ -124,15 +123,16 @@ callbacks. Write the vendor IDs into `consent-scripts.ts`. See
124
123
  Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
125
124
 
126
125
  ```ts title="src/main.ts"
126
+ import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
127
127
  import { scripts } from './consent-scripts';
128
128
 
129
129
  app.use(c15tVue, {
130
- backendURL: 'https://your-project.inth.app',
130
+ mode: manifest(),
131
131
  scripts,
132
132
  });
133
133
  ```
134
134
 
135
- Keep your existing backend URL and other options. The plugin starts one
135
+ Keep your existing `mode` and other options. The plugin starts one
136
136
  script loader when the app mounts, after it has applied the visitor's stored
137
137
  choice. Do not also call `createScriptLoader` from a component. See
138
138
  [Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
@@ -140,12 +140,11 @@ choice. Do not also call `createScriptLoader` from a component. See
140
140
  **Astro**
141
141
 
142
142
  Add the scripts to the client entrypoint from the
143
- [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), the module that the
144
- integration's `clientEntrypoint` option names. Keep `mode`, `ui` and the
145
- framework integration in `astro.config.mjs` as they are. If the module
146
- already exports scripts, combine the two arrays.
143
+ [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
144
+ which the integration finds on its own. Keep `astro.config.mjs` as it is.
145
+ If the module already exports scripts, combine the two arrays.
147
146
 
148
- ```ts title="src/consent-client.ts"
147
+ ```ts title="src/c15t.client.ts"
149
148
  import type { C15tClientOptionsExtension } from 'c15t/astro';
150
149
  import { scripts } from './consent-scripts';
151
150
 
@@ -165,15 +164,13 @@ pass them as a top-level prop:
165
164
 
166
165
  ```svelte title="src/App.svelte"
167
166
  <script lang="ts">
168
- import { ConsentManagerProvider, hosted } from '@c15t/svelte';
167
+ import { ConsentProvider, manifest } from '@c15t/svelte';
169
168
  import { scripts } from './consent-scripts';
170
-
171
- const mode = hosted({ url: 'https://your-project.inth.app' });
172
169
  </script>
173
170
 
174
- <ConsentManagerProvider {mode} {scripts}>
171
+ <ConsentProvider mode={manifest()} {scripts}>
175
172
  <!-- Keep your application, consent UI and preferences link here. -->
176
- </ConsentManagerProvider>
173
+ </ConsentProvider>
177
174
  ```
178
175
 
179
176
  Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
@@ -181,22 +178,21 @@ The provider owns the loader and disposes it on unmount.
181
178
 
182
179
  **SvelteKit**
183
180
 
184
- Add the scripts to the existing root layout provider. Keep the server load
185
- and its serializable prefetch data from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
181
+ Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
182
+ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
186
183
 
187
184
  ```svelte title="src/routes/+layout.svelte"
188
185
  <script lang="ts">
189
- import { ConsentManagerProvider, hosted } from '@c15t/svelte';
186
+ import { ConsentRoot } from '@c15t/svelte';
190
187
  import { scripts } from '../consent-scripts';
191
188
 
192
189
  let { children, data } = $props();
193
- const mode = hosted({ url: 'https://your-project.inth.app' });
194
190
  </script>
195
191
 
196
- <ConsentManagerProvider {mode} {scripts} prefetch={data.prefetch}>
192
+ <ConsentRoot state={data.consent} {scripts}>
197
193
  {@render children()}
198
194
  <!-- Keep your consent UI and preferences link here. -->
199
- </ConsentManagerProvider>
195
+ </ConsentRoot>
200
196
  ```
201
197
 
202
198
  Import vendor helpers in the layout component, not in `+layout.server.ts`:
@@ -223,20 +219,19 @@ to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/sc
223
219
 
224
220
  **JavaScript**
225
221
 
226
- Pass the scripts to `init()` from `@c15t/browser`, next to your backend
227
- URL:
222
+ Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
228
223
 
229
224
  ```ts
230
- import { init } from '@c15t/browser';
225
+ import { init, manifest } from '@c15t/browser';
231
226
  import { scripts } from './consent-scripts';
232
227
 
233
228
  const consent = init({
234
- backendURL: 'https://your-project.inth.app',
229
+ mode: manifest(),
235
230
  scripts,
236
231
  });
237
232
  ```
238
233
 
239
- Keep the backend URL from your quickstart. With
234
+ Keep the mode from your quickstart. With
240
235
  `createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
241
236
  A kernel you create yourself needs a loader from
242
237
  `c15t/modules/script-loader`. Attach one loader per kernel. See
@@ -246,7 +241,7 @@ A kernel you create yourself needs a loader from
246
241
 
247
242
  | Option | Default | Behavior |
248
243
  | ---------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
249
- | `appId` | Required | App ID passed to `LogRocket.init`. The helper trims it. Values that are not two non-empty segments separated by `/` throw. |
244
+ | `appId` | Required | App ID passed to `LogRocket.init`. The helper trims it. Values that are not two non-empty segments separated by `/` log an error and the script does not load. |
250
245
  | `initOptions` | `{}` | Second argument to `LogRocket.init`. Use JSON-serializable values only, so functions such as request sanitizers cannot pass through. |
251
246
  | `scriptUrl` | `https://cdn.logrocket.io/LogRocket.min.js` | Loader URL override. A blank value falls back to the default. |
252
247
  | `asyncScriptUrl` | None | Proxied URL for LogRocket's logger bundle, set as `window._lrAsyncScript` before the loader runs. Set it only when you proxy LogRocket through your own domain. |
@@ -290,8 +285,8 @@ permission before each of your own event calls. The reload does not delete
290
285
  cookies the vendor already set; see
291
286
  [clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
292
287
 
293
- The helper sets `vendor` to its script ID, so once you declare that vendor a
294
- visitor can turn it off inside an allowed category. See
288
+ The helper lists its vendor by name in the preference dialog, so a visitor can
289
+ turn it off inside an allowed category. See
295
290
  [vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
296
291
  [consent verification guide](../guides/verify-consent.md) covers navigation,
297
292
  expiry and hosting checks.