@c15t/react 3.2.0-canary.0 → 3.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 (50) hide show
  1. package/AGENTS.md +33 -10
  2. package/README.md +5 -7
  3. package/dist/styles.tw3.css +2 -2
  4. package/dist/version.js +1 -1
  5. package/dist-types/version.d.ts +1 -1
  6. package/docs/README.md +33 -10
  7. package/docs/concepts/choose-your-setup.md +8 -9
  8. package/docs/concepts/modes.md +5 -3
  9. package/docs/customization/stylesheets.md +39 -0
  10. package/docs/frameworks/react/hooks.md +2 -1
  11. package/docs/frameworks/react/quickstart.md +3 -3
  12. package/docs/frameworks/react/upgrade-v3.md +2 -2
  13. package/docs/integrations/activecampaign.md +297 -0
  14. package/docs/integrations/ada.md +396 -0
  15. package/docs/integrations/adobe-target.md +460 -0
  16. package/docs/integrations/adroll.md +336 -0
  17. package/docs/integrations/amazon-ads.md +424 -0
  18. package/docs/integrations/appcues.md +368 -0
  19. package/docs/integrations/attentive.md +313 -0
  20. package/docs/integrations/building-integrations.md +29 -16
  21. package/docs/integrations/clearbit.md +1 -1
  22. package/docs/integrations/customer-io.md +369 -0
  23. package/docs/integrations/databuddy.md +139 -50
  24. package/docs/integrations/default-com.md +497 -0
  25. package/docs/integrations/dynamic-yield.md +373 -0
  26. package/docs/integrations/fullstory.md +298 -0
  27. package/docs/integrations/gainsight-px.md +418 -0
  28. package/docs/integrations/gorgias.md +365 -0
  29. package/docs/integrations/hubspot.md +529 -0
  30. package/docs/integrations/insider.md +550 -0
  31. package/docs/integrations/liveintent.md +327 -0
  32. package/docs/integrations/lucky-orange.md +336 -0
  33. package/docs/integrations/marketo.md +309 -0
  34. package/docs/integrations/optimizely.md +411 -0
  35. package/docs/integrations/oracle-eloqua.md +301 -0
  36. package/docs/integrations/overview.md +124 -111
  37. package/docs/integrations/pendo.md +339 -0
  38. package/docs/integrations/rb2b.md +363 -0
  39. package/docs/integrations/salesforce-pardot.md +342 -0
  40. package/docs/integrations/statable-analytics.md +345 -0
  41. package/docs/integrations/the-trade-desk.md +328 -0
  42. package/docs/integrations/vector.md +333 -0
  43. package/docs/integrations/wisepops.md +416 -0
  44. package/docs/integrations/zendesk.md +359 -0
  45. package/package.json +8 -8
  46. package/docs/integrations/other-ads-and-pixels.md +0 -94
  47. package/docs/integrations/other-analytics.md +0 -108
  48. package/docs/integrations/other-chat-and-support.md +0 -112
  49. package/docs/integrations/other-email-and-sms.md +0 -156
  50. package/docs/integrations/other-experience.md +0 -222
@@ -0,0 +1,396 @@
1
+ ---
2
+ title: Ada
3
+ description: Load Ada Messaging after functionality consent with the c15t ada
4
+ helper, configure regional Agents, and stop the widget when consent is
5
+ revoked.
6
+ seoTitle: Ada Messaging cookie consent with c15t
7
+ seoDescription: Gate Ada Messaging on functionality consent with c15t. Keep the
8
+ SDK interface private, stop the widget on revocation, and verify its requests
9
+ and storage.
10
+ icon: bot
11
+ group: integrations
12
+ ---
13
+
14
+ Ada Messaging adds an Ada AI Agent chat widget to your site. The c15t `ada`
15
+ helper waits for `functionality` consent before it imports Ada's Messaging Web
16
+ SDK, and it keeps the Messaging interface private.
17
+
18
+ When the visitor withdraws, the helper calls Ada's `stop()` to remove the
19
+ widget, and c15t reloads the page by default. `stop()` doesn't delete stored
20
+ conversations or cookies.
21
+
22
+ ## Configure Ada Messaging
23
+
24
+ Get your AI Agent's public `handle` from your Ada team. Most installations
25
+ need only the handle. Set `cluster` or `domain` only when Ada gives you a
26
+ regional configuration.
27
+
28
+ Remove any existing Ada module snippet, `embed2.js` script tag, or tag-manager
29
+ installation. A separate Ada installation can load before c15t grants consent,
30
+ and Ada allows only one Messaging interface per page.
31
+
32
+ | Package manager | Command |
33
+ | :-------------- | :------------------------------- |
34
+ | npm | `npm install @c15t/integrations` |
35
+ | pnpm | `pnpm add @c15t/integrations` |
36
+ | yarn | `yarn add @c15t/integrations` |
37
+ | bun | `bun add @c15t/integrations` |
38
+
39
+ ```ts title="src/consent-scripts.ts"
40
+ import { ada } from '@c15t/integrations/ada';
41
+
42
+ export const scripts = [ada({ handle: 'YOUR_ADA_HANDLE' })];
43
+ ```
44
+
45
+ ## Register the scripts
46
+
47
+ Complete your [framework quickstart](https://c15t.com/docs/frameworks) first. Keep its Inth
48
+ endpoint, policy, styles and consent UI. Remove the vendor's original script,
49
+ SDK initializer or tag-manager entry, so the vendor loads only through c15t.
50
+
51
+ The vendor pages put the helper in `src/consent-scripts.ts`. If your framework
52
+ quickstart already has a `scripts` array, such as the one in `c15t.config.ts`
53
+ in the Next.js guide, add the helper to that array instead of creating a
54
+ second file.
55
+ The `scripts` export is a configuration, not an initializer. Add it to the c15t provider you already have, at the registration
56
+ point for your framework below. These are edits to that provider, not a second
57
+ provider.
58
+
59
+ **Next.js**
60
+
61
+ Add the configuration to `scripts` in `c15t.config.ts`, next to
62
+ `next.config.ts`:
63
+
64
+ ```ts title="c15t.config.ts"
65
+ import { defineConsentConfig } from 'c15t/next';
66
+ import { scripts } from './src/consent-scripts';
67
+
68
+ export default defineConsentConfig({ scripts });
69
+ ```
70
+
71
+ Keep the rest of your config, such as `mode` and `routePrefix`, in the
72
+ same call. `ConsentRoot` reads the config in the browser, so the layout
73
+ keeps passing only `state`. App Router, Pages Router and static export all
74
+ read the same file. See
75
+ [Next.js scripts and embeds](https://c15t.com/docs/frameworks/next/scripts).
76
+
77
+ **TanStack Start**
78
+
79
+ Import the configuration into your root route and pass it to the existing
80
+ `ConsentRoot` as a top-level prop. Keep the loader from the
81
+ [TanStack Start quickstart](https://c15t.com/docs/frameworks/tanstack-start/quickstart):
82
+
83
+ ```tsx title="src/routes/__root.tsx"
84
+ import { scripts } from '../consent-scripts';
85
+
86
+ <ConsentRoot state={consent} scripts={scripts}>
87
+ ```
88
+
89
+ Import vendor helpers in the root route module, not in a server function.
90
+ A server function's return value must be serializable, and script
91
+ configurations carry callbacks. See
92
+ [TanStack Start scripts](https://c15t.com/docs/frameworks/tanstack-start/scripts).
93
+
94
+ **React**
95
+
96
+ Add the configuration to the existing `ConsentProvider` options, next to
97
+ `mode`:
98
+
99
+ ```tsx title="src/consent.tsx"
100
+ import { scripts } from './consent-scripts';
101
+
102
+ <ConsentProvider options={{ mode, scripts }}>
103
+ ```
104
+
105
+ `mode` is the `manifest()` value from the
106
+ [React quickstart](../frameworks/react/quickstart.md). Keep the banner,
107
+ dialog and preferences link inside the provider. See
108
+ [React scripts and embeds](../frameworks/react/scripts.md).
109
+
110
+ **Nuxt**
111
+
112
+ Register the scripts under the `c15t` key in `app/app.config.ts`. Adjust the
113
+ relative import to where you created `consent-scripts.ts`:
114
+
115
+ ```ts title="app/app.config.ts"
116
+ import { scripts } from '../src/consent-scripts';
117
+
118
+ export default defineAppConfig({
119
+ c15t: { scripts },
120
+ });
121
+ ```
122
+
123
+ The Nuxt module merges this over its options in `nuxt.config.ts` and starts
124
+ one script loader in the browser after hydration, once it has applied the
125
+ visitor's stored choice and privacy signals. Keep `scripts` out of
126
+ `nuxt.config.ts`, which reaches the browser as JSON and drops the vendor
127
+ callbacks. Write the vendor IDs into `consent-scripts.ts`. See
128
+ [Nuxt scripts and embeds](https://c15t.com/docs/frameworks/nuxt/scripts).
129
+
130
+ **Vue**
131
+
132
+ Pass the scripts to the existing `c15tVue` plugin call in `src/main.ts`:
133
+
134
+ ```ts title="src/main.ts"
135
+ import { c15tVue, manifest } from 'c15t/vue/vue-plugin';
136
+ import { scripts } from './consent-scripts';
137
+
138
+ app.use(c15tVue, {
139
+ mode: manifest(),
140
+ scripts,
141
+ });
142
+ ```
143
+
144
+ Keep your existing `mode` and other options. The plugin starts one
145
+ script loader when the app mounts, after it has applied the visitor's stored
146
+ choice. Do not also call `createScriptLoader` from a component. See
147
+ [Vue scripts and embeds](https://c15t.com/docs/frameworks/vue/scripts).
148
+
149
+ **Astro**
150
+
151
+ Add the scripts to the client entrypoint from the
152
+ [Astro quickstart](https://c15t.com/docs/frameworks/astro/quickstart), `src/c15t.client.ts`,
153
+ which the integration finds on its own. Keep `astro.config.mjs` as it is.
154
+ If the module already exports scripts, combine the two arrays.
155
+
156
+ ```ts title="src/c15t.client.ts"
157
+ import type { C15tClientOptionsExtension } from 'c15t/astro';
158
+ import { scripts } from './consent-scripts';
159
+
160
+ export default { scripts } satisfies C15tClientOptionsExtension;
161
+ ```
162
+
163
+ Vendor helpers contain callbacks, and the integration options in
164
+ `astro.config.mjs` are serialized into the page, so do not put helpers in
165
+ the integration's `scripts` option. The integration passes the client
166
+ entrypoint to the one runtime every page shares, including across
167
+ `ClientRouter` navigation.
168
+
169
+ **Svelte**
170
+
171
+ Import the scripts in the component that owns your existing provider and
172
+ pass them as a top-level prop:
173
+
174
+ ```svelte title="src/App.svelte"
175
+ <script lang="ts">
176
+ import { ConsentProvider, manifest } from 'c15t/svelte';
177
+ import { scripts } from './consent-scripts';
178
+ </script>
179
+
180
+ <ConsentProvider mode={manifest()} {scripts}>
181
+ <!-- Keep your application, consent UI and preferences link here. -->
182
+ </ConsentProvider>
183
+ ```
184
+
185
+ Retain the styles and consent UI from the [Svelte quickstart](https://c15t.com/docs/frameworks/svelte/quickstart).
186
+ The provider owns the loader and disposes it on unmount.
187
+
188
+ **SvelteKit**
189
+
190
+ Add the scripts to the existing `ConsentRoot` in the root layout. Keep the
191
+ handle and the layout load from the [SvelteKit quickstart](https://c15t.com/docs/frameworks/sveltekit/quickstart).
192
+
193
+ ```svelte title="src/routes/+layout.svelte"
194
+ <script lang="ts">
195
+ import { ConsentRoot } from 'c15t/svelte';
196
+ import { scripts } from '../consent-scripts';
197
+
198
+ let { children, data } = $props();
199
+ </script>
200
+
201
+ <ConsentRoot state={data.consent} {scripts}>
202
+ {@render children()}
203
+ <!-- Keep your consent UI and preferences link here. -->
204
+ </ConsentRoot>
205
+ ```
206
+
207
+ Import vendor helpers in the layout component, not in `+layout.server.ts`:
208
+ a server load cannot send functions to the browser. Prerendered, static and
209
+ SPA-mode pages use the same `scripts` prop. If you pass an externally owned
210
+ `runtime` to the provider, register scripts when creating that runtime instead.
211
+
212
+ **HTML**
213
+
214
+ The helpers in `@c15t/integrations` are ES modules that need a bundler. On a
215
+ page that loads the c15t script tag, paste the vendor's own snippet instead
216
+ and keep it inert until its category is allowed:
217
+
218
+ ```html
219
+ <script type="text/plain" data-c15t-category="measurement">
220
+ // The vendor's snippet, unchanged
221
+ </script>
222
+ ```
223
+
224
+ Use the category this guide names for the vendor. c15t runs the snippet
225
+ once that category is allowed, and reloads the page when the visitor
226
+ withdraws it. Helper options on this page, such as `loadMode`, do not apply
227
+ to a pasted snippet. See [HTML scripts](https://c15t.com/docs/frameworks/html/scripts).
228
+
229
+ **JavaScript**
230
+
231
+ Pass the scripts to `init()` from `@c15t/browser`, next to your mode:
232
+
233
+ ```ts
234
+ import { init, manifest } from '@c15t/browser';
235
+ import { scripts } from './consent-scripts';
236
+
237
+ const consent = init({
238
+ mode: manifest(),
239
+ scripts,
240
+ });
241
+ ```
242
+
243
+ Keep the mode from your quickstart. With
244
+ `createConsentRuntime` from `c15t/runtime`, pass `scripts` to it instead.
245
+ A kernel you create yourself needs a loader from
246
+ `c15t/modules/script-loader`. Attach one loader per kernel. See
247
+ [JavaScript scripts](https://c15t.com/docs/frameworks/javascript/scripts).
248
+
249
+ This helper targets the Messaging Web SDK. It doesn't load the legacy Chat SDK
250
+ and has no `legacy` option.
251
+
252
+ ## Options
253
+
254
+ | Option | Default | Behavior |
255
+ | --------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
256
+ | `handle` | Required | Public AI Agent handle passed to `start()`. Surrounding whitespace is trimmed. If it's missing or blank, c15t logs `ada: missing or invalid handle` and never loads Ada. |
257
+ | `cluster` | Ada's default region | Regional segment, such as `eu`, `us2` or `maple`, or a full cluster domain supplied by Ada. Trimmed. Blank values are omitted. |
258
+ | `domain` | Ada's default domain | Ada base-domain segment. Use only the value Ada gives you. Trimmed. Blank values are omitted. |
259
+
260
+ The helper imports `https://messaging-assets.ada.support/sdk.js`. You can't
261
+ set a custom SDK URL, and the helper doesn't bundle the runtime into your app.
262
+ Ada's entry module imports the current runtime from its CDN.
263
+
264
+ If your site has a Content Security Policy, allow
265
+ `https://messaging-assets.ada.support` in `script-src`, `connect-src` and
266
+ `frame-src`. Also allow your Agent's API origin in `connect-src`. Follow
267
+ [Ada's CSP instructions](https://docs.ada.cx/messaging/web/getting-started#content-security-policy)
268
+ for the origin that matches your handle and region.
269
+
270
+ ## Loading and revocation
271
+
272
+ The helper returns a callback-only c15t script with no `src`. When its consent
273
+ is granted, it imports the SDK, calls the module's `createAdaEmbedInterface()`
274
+ export, and awaits `start({ handle, cluster, domain })`. It creates no
275
+ `window.adaEmbed` or `window.adaSettings` global. Repeated consent updates don't
276
+ start a second widget.
277
+
278
+ The helper checks the permission c15t passes to it, so if you change the
279
+ script's category, the gate changes too. The visitor's Ada vendor switch
280
+ applies inside an allowed category.
281
+
282
+ ### One configuration per page
283
+
284
+ Keep one Ada helper in your scripts array. Helpers with the same handle,
285
+ cluster and domain share one private interface, and Messaging stops when the
286
+ last of them is revoked or disposed.
287
+
288
+ A helper with different settings doesn't change the running widget. When it
289
+ gets consent while another configuration is active, it logs a `console.warn`
290
+ (`ada: Ada supports one configuration per page`) and does nothing until the
291
+ page reloads. It stays ignored even after the first configuration stops.
292
+
293
+ ### Stopping the widget
294
+
295
+ When the last granted registration loses consent or is disposed, the helper
296
+ calls `stop()`. Ada documents that `stop()` removes the SDK frames and
297
+ interrupts a pending `start()`. A later grant waits for the earlier start and
298
+ stop to finish, then starts the same interface again. Once every registration
299
+ is gone and `stop()` has run, a new registration can start it with different
300
+ settings.
301
+
302
+ If consent is withdrawn while the SDK import is still pending, the helper
303
+ doesn't create or start the interface when the import finishes. Browsers can't
304
+ cancel a dynamic import that has already begun, so the SDK can still fetch its
305
+ dependencies and write its own bootstrap storage. Keep `reloadOnConsentRevoked`
306
+ enabled to end that work. Imported code stays in memory until the page unloads.
307
+
308
+ Ada has no documented consent signal or opt-out action. `stop()` doesn't
309
+ promise to erase conversation history, stored tokens or cookies. The helper
310
+ doesn't call `deleteHistory()`, which permanently deletes the conversation and
311
+ resets the session.
312
+
313
+ ### Errors
314
+
315
+ The helper logs failures with `console.error` and doesn't throw:
316
+
317
+ * If the import fails, the module has no `createAdaEmbedInterface` export, or
318
+ `start()` rejects, it logs `ada: failed to start Messaging.` and drops the
319
+ current registrations. The next consent update can try again, or another
320
+ configuration can start instead.
321
+ * If `stop()` rejects, it logs `ada: failed to stop Messaging.`
322
+
323
+ ## Cookies and storage
324
+
325
+ [Ada's client-side storage list](https://static.ada.support/ada-web-storage-list.html)
326
+ covers several SDK generations and optional integrations. Entries include:
327
+
328
+ | Name | Purpose and retention |
329
+ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
330
+ | `__Host-ada-session-[session ID]-[generation]` | Server-set HttpOnly refresh credential on the Agent's Ada subdomain. Ada lists a session duration of up to seven days. |
331
+ | `ada-embed_*`, `ada-embed-*`, `ada-functional-storage` | SDK state, session values and version caches. Ada lists these as persistent Web Storage. |
332
+ | `chatter`, `created`, `inLiveChat`, `messagingAuthState` | Conversation, session, handoff and authentication state. Ada lists persistent Web Storage, including entries on the Ada domain. |
333
+
334
+ The hosted SDK bootstrap also stores rollout assignments under
335
+ `ada-messaging-sdk-rollout:*` in the host page's local storage. This happens
336
+ while the module evaluates, which is why c15t gates the import itself.
337
+ Rollout assignments can remain after `stop()`.
338
+
339
+ Your Agent can embed other services, such as Calendly, YouTube or a live
340
+ support platform. Their storage depends on your configuration, so inspect the
341
+ widget's frames as well as the host page. JavaScript on your page can't read
342
+ or clear Ada's HttpOnly cookies on another origin.
343
+
344
+ ## Verify Ada Messaging
345
+
346
+ Use a private window with an opt-in policy and your real Ada handle. In
347
+ DevTools, disable the Network cache and filter by `ada.support`:
348
+
349
+ 1. Load the page without granting functionality. No Ada module, manifest,
350
+ iframe or API request appears, and the fresh browser context has no Ada
351
+ storage.
352
+ 2. Reject optional consent and reload. Ada still makes no request.
353
+ 3. Allow functionality. Look for `sdk.js`, the rollout manifest, the versioned
354
+ SDK module and the Ada launcher. `window.adaEmbed` stays undefined.
355
+ 4. Revoke functionality or turn off the Ada vendor switch. The helper calls
356
+ `stop()`, and c15t reloads by default. The new page makes no Ada request.
357
+ Stored conversation data can remain.
358
+ 5. Allow functionality again. The widget starts once. Repeat the grant and
359
+ revoke steps on a throttled network to check a pending startup.
360
+
361
+ Check the console too. An `ada:` warning means a second configuration with
362
+ different settings is in your scripts array.
363
+
364
+ The helper already calls `stop()`, the opt-out step the shared checklist below
365
+ asks for. Keep the reload enabled anyway, for an import that's still pending.
366
+
367
+ Sources: [Messaging Web SDK installation](https://docs.ada.cx/messaging/web/getting-started#embed-with-a-module-script),
368
+ [settings and lifecycle actions](https://docs.ada.cx/messaging/web/sdk-api-reference),
369
+ [keep the Messaging interface private](https://docs.ada.cx/messaging/web/security-best-practices#keep-the-client-in-a-private-scope),
370
+ and [Ada's client-side storage list](https://static.ada.support/ada-web-storage-list.html).
371
+
372
+ Test in a private window with an opt-in policy. Open DevTools Network, disable
373
+ the cache and filter by the vendor's domain:
374
+
375
+ 1. Load the page. No request goes to the vendor before you choose.
376
+ 2. Click Reject, then reload. There is still no vendor request.
377
+ 3. Open Privacy settings and allow the helper's category. The vendor script
378
+ loads without a page reload.
379
+ 4. Turn the category off again and save. c15t reloads the page, and the new
380
+ page makes no vendor request.
381
+
382
+ c15t reloads on revocation because removing a script element does not stop
383
+ code that already ran. The vendor's listeners, timers and queued events stay
384
+ alive until the page unloads. If you set `reloadOnConsentRevoked: false`, stop
385
+ the vendor yourself. Register a callback-only script whose `onConsentChange`
386
+ calls the vendor's opt-out API, as shown in
387
+ [custom integrations](./building-integrations.md), and check the
388
+ permission before each of your own event calls. The reload does not delete
389
+ cookies the vendor already set; see
390
+ [clear on revocation for your framework](./overview.md#vendor-switches-and-cookie-cleanup).
391
+
392
+ The helper lists its vendor by name in the preference dialog, so a visitor can
393
+ turn it off inside an allowed category. See
394
+ [vendor consent for your framework](./overview.md#vendor-switches-and-cookie-cleanup). The
395
+ [consent verification guide](../guides/verify-consent.md) covers navigation,
396
+ expiry and hosting checks.