@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.
- package/AGENTS.md +155 -0
- package/README.md +31 -15
- package/client/components/integrations.js +3 -0
- package/dist/components/integrations/index.cjs +1 -0
- package/dist/components/integrations/index.js +1 -0
- package/dist/headless.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/libs/browser-initial-data.cjs +1 -1
- package/dist/libs/initial-data.cjs +1 -1
- package/dist/styles.tw3.css +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist-types/components/integrations/index.d.ts +1 -0
- package/dist-types/libs/browser-initial-data.d.ts +1 -1
- package/dist-types/version.d.ts +1 -1
- package/docs/README.md +155 -73
- package/docs/{building-headless-components.md → frameworks/next/building-headless-components.md} +3 -1
- package/docs/{callbacks.md → frameworks/next/callbacks.md} +3 -1
- package/docs/{components → frameworks/next/components}/consent-banner.md +10 -21
- package/docs/{components → frameworks/next/components}/consent-dialog-link.md +8 -5
- package/docs/frameworks/next/components/consent-dialog-trigger.md +202 -0
- package/docs/{components → frameworks/next/components}/consent-dialog.md +7 -15
- package/docs/frameworks/next/components/consent-manager-provider.md +327 -0
- package/docs/{components → frameworks/next/components}/consent-widget.md +8 -6
- package/docs/{components → frameworks/next/components}/dev-tools.md +9 -6
- package/docs/{components → frameworks/next/components}/frame.md +8 -9
- package/docs/{concepts → frameworks/next/concepts}/client-modes.md +4 -2
- package/docs/{concepts → frameworks/next/concepts}/consent-categories.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/consent-models.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/cookie-management.md +3 -3
- package/docs/{concepts → frameworks/next/concepts}/glossary.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/initialization-flow.md +1 -0
- package/docs/{concepts → frameworks/next/concepts}/policy-packs.md +1 -0
- package/docs/{headless.md → frameworks/next/headless.md} +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-color-scheme.md +1 -0
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/checking-consent.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/location-info.md +3 -1
- package/docs/frameworks/next/hooks/use-consent-manager/overview.md +185 -0
- package/docs/{hooks → frameworks/next/hooks}/use-consent-manager/setting-consent.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-draggable.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-focus-trap.md +1 -0
- package/docs/{hooks → frameworks/next/hooks}/use-reduced-motion.md +3 -1
- package/docs/{hooks → frameworks/next/hooks}/use-ssr-status.md +6 -5
- package/docs/{hooks → frameworks/next/hooks}/use-text-direction.md +1 -0
- package/docs/frameworks/next/hooks/use-translations.md +55 -0
- package/docs/{iab → frameworks/next/iab}/consent-banner.md +9 -12
- package/docs/{iab → frameworks/next/iab}/consent-dialog.md +9 -14
- package/docs/{iab → frameworks/next/iab}/overview.md +4 -2
- package/docs/{iab → frameworks/next/iab}/use-gvl-data.md +3 -2
- package/docs/{iframe-blocking.md → frameworks/next/iframe-blocking.md} +8 -9
- package/docs/{internationalization.md → frameworks/next/internationalization.md} +13 -3
- package/docs/{network-blocker.md → frameworks/next/network-blocker.md} +13 -51
- package/docs/{optimization.md → frameworks/next/optimization.md} +5 -4
- package/docs/{policy-packs.md → frameworks/next/policy-packs.md} +3 -1
- package/docs/{quickstart.md → frameworks/next/quickstart.md} +26 -42
- package/docs/{script-loader.md → frameworks/next/script-loader.md} +72 -90
- package/docs/{server-side.md → frameworks/next/server-side.md} +12 -15
- package/docs/{styling → frameworks/next/styling}/classnames.md +3 -1
- package/docs/{styling → frameworks/next/styling}/color-scheme.md +3 -1
- package/docs/frameworks/next/styling/css-variables.md +53 -0
- package/docs/frameworks/next/styling/overview.md +299 -0
- package/docs/frameworks/next/styling/slots.md +94 -0
- package/docs/{styling → frameworks/next/styling}/tailwind.md +3 -1
- package/docs/frameworks/next/styling/tokens.md +156 -0
- package/docs/{troubleshooting.md → frameworks/next/troubleshooting.md} +3 -1
- package/docs/integrations/adobe-analytics.md +160 -0
- package/docs/integrations/ahrefs-analytics.md +15 -82
- package/docs/integrations/amplitude.md +230 -0
- package/docs/integrations/building-integrations.md +15 -181
- package/docs/integrations/clearbit.md +130 -0
- package/docs/integrations/cloudflare-web-analytics.md +15 -83
- package/docs/integrations/crisp.md +13 -87
- package/docs/integrations/databuddy.md +16 -85
- package/docs/integrations/fathom-analytics.md +15 -86
- package/docs/integrations/google-maps.md +263 -0
- package/docs/integrations/google-tag-manager.md +18 -86
- package/docs/integrations/google-tag.md +15 -84
- package/docs/integrations/heap.md +219 -0
- package/docs/integrations/hightouch.md +199 -0
- package/docs/integrations/hotjar.md +15 -83
- package/docs/integrations/intercom.md +13 -83
- package/docs/integrations/linkedin-insights.md +15 -82
- package/docs/integrations/logrocket.md +175 -0
- package/docs/integrations/matomo-analytics.md +13 -88
- package/docs/integrations/meta-pixel.md +33 -316
- package/docs/integrations/microsoft-clarity.md +15 -83
- package/docs/integrations/microsoft-uet.md +16 -83
- package/docs/integrations/mixpanel-analytics.md +15 -83
- package/docs/integrations/overview.md +55 -6
- package/docs/integrations/pirsch.md +142 -0
- package/docs/integrations/plausible-analytics.md +14 -97
- package/docs/integrations/posthog.md +26 -98
- package/docs/integrations/promptwatch.md +16 -82
- package/docs/integrations/reddit-pixel.md +27 -122
- package/docs/integrations/rudderstack.md +271 -0
- package/docs/integrations/rybbit-analytics.md +15 -94
- package/docs/integrations/segment.md +15 -82
- package/docs/integrations/snapchat-pixel.md +21 -102
- package/docs/integrations/tiktok-pixel.md +13 -81
- package/docs/integrations/umami-analytics.md +16 -88
- package/docs/integrations/vercel-analytics.md +13 -85
- package/docs/integrations/x-pixel.md +27 -102
- package/docs/integrations/youtube.md +193 -0
- package/docs/shared/concepts/client-modes.md +103 -0
- package/docs/shared/concepts/consent-categories.md +41 -0
- package/docs/shared/concepts/consent-models.md +72 -0
- package/docs/shared/concepts/cookie-management.md +88 -0
- package/docs/shared/concepts/glossary.md +24 -0
- package/docs/shared/concepts/initialization-flow.md +105 -0
- package/docs/shared/concepts/policy-packs.md +225 -0
- package/docs/shared/react/components/consent-banner.md +242 -0
- package/docs/shared/react/components/consent-dialog-link.md +45 -0
- package/docs/shared/react/components/consent-dialog-trigger.md +185 -0
- package/docs/shared/react/components/consent-dialog.md +119 -0
- package/docs/shared/react/components/consent-manager-provider.md +225 -0
- package/docs/shared/react/components/consent-widget.md +121 -0
- package/docs/shared/react/components/dev-tools.md +81 -0
- package/docs/shared/react/components/frame.md +52 -0
- package/docs/shared/react/guides/building-headless-components.md +110 -0
- package/docs/shared/react/guides/callbacks.md +89 -0
- package/docs/shared/react/guides/headless.md +31 -0
- package/docs/shared/react/guides/iframe-blocking.md +65 -0
- package/docs/shared/react/guides/internationalization.md +123 -0
- package/docs/shared/react/guides/network-blocker.md +72 -0
- package/docs/shared/react/guides/optimization.md +44 -0
- package/docs/shared/react/guides/policy-packs.md +173 -0
- package/docs/shared/react/guides/script-loader.md +311 -0
- package/docs/shared/react/hooks/use-color-scheme.md +31 -0
- package/docs/shared/react/hooks/use-consent-manager/checking-consent.md +95 -0
- package/docs/shared/react/hooks/use-consent-manager/location-info.md +96 -0
- package/docs/shared/react/hooks/use-consent-manager/overview.md +74 -0
- package/docs/shared/react/hooks/use-consent-manager/setting-consent.md +93 -0
- package/docs/shared/react/hooks/use-draggable.md +30 -0
- package/docs/shared/react/hooks/use-focus-trap.md +20 -0
- package/docs/shared/react/hooks/use-reduced-motion.md +33 -0
- package/docs/shared/react/hooks/use-ssr-status.md +16 -0
- package/docs/shared/react/hooks/use-text-direction.md +38 -0
- package/docs/shared/react/hooks/use-translations.md +15 -0
- package/docs/shared/react/iab/consent-banner.md +60 -0
- package/docs/shared/react/iab/consent-dialog.md +76 -0
- package/docs/shared/react/iab/overview.md +80 -0
- package/docs/shared/react/iab/use-gvl-data.md +21 -0
- package/docs/shared/react/styling/classnames.md +93 -0
- package/docs/shared/react/styling/color-scheme.md +35 -0
- package/docs/shared/react/styling/css-variables.md +53 -0
- package/docs/shared/react/styling/overview.md +261 -0
- package/docs/shared/react/styling/slots.md +93 -0
- package/docs/shared/react/styling/stylesheet-entrypoint.md +8 -0
- package/docs/shared/react/styling/tailwind.md +88 -0
- package/docs/shared/react/styling/tokens.md +155 -0
- package/docs/shared/troubleshooting.md +82 -0
- package/package.json +19 -10
- package/readme.json +14 -8
- package/docs/ai-agents.md +0 -111
- package/docs/components/consent-dialog-trigger.md +0 -103
- package/docs/components/consent-manager-provider.md +0 -425
- package/docs/hooks/use-consent-manager/overview.md +0 -420
- package/docs/hooks/use-translations.md +0 -118
- package/docs/styling/css-variables.md +0 -92
- package/docs/styling/overview.md +0 -457
- package/docs/styling/slots.md +0 -128
- package/docs/styling/tokens.md +0 -216
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Build a Custom Script Integration
|
|
3
|
-
description: Learn when to use a raw Script, when to build a reusable
|
|
4
|
-
|
|
3
|
+
description: Learn when to use a raw Script, when to build a reusable
|
|
4
|
+
manifest-backed integration, and how to debug and test custom consent-aware
|
|
5
|
+
scripts in c15t.
|
|
6
|
+
group: integrations
|
|
5
7
|
---
|
|
6
8
|
If you cannot find a prebuilt integration in [`@c15t/scripts`](/docs/integrations), you have two good options:
|
|
7
9
|
|
|
@@ -220,186 +222,18 @@ If the vendor snippet is tiny, unique to one app, or mostly static, a plain `Scr
|
|
|
220
222
|
|
|
221
223
|
### Script
|
|
222
224
|
|
|
223
|
-
|Property|
|
|
224
|
-
|
|
225
|
-
|
|
|
226
|
-
|src
|
|
227
|
-
|textContent|string \|undefined|Inline JavaScript code to execute|-|Optional|
|
|
228
|
-
|category|HasCondition\<AllConsentNames>|Consent category or condition required to load this script|-|✅ Required|
|
|
229
|
-
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
230
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
231
|
-
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
232
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
233
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
234
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
235
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
236
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
237
|
-
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
238
|
-
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
239
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
240
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
241
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
242
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
243
|
-
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
244
|
-
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
245
|
-
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
246
|
-
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
247
|
-
|
|
248
|
-
#### `onBeforeLoad`
|
|
249
|
-
|
|
250
|
-
Callback executed before the script is loaded
|
|
251
|
-
|
|
252
|
-
|Property|Type|Description|Default|Required|
|
|
253
|
-
|:--|:--|:--|:--|:--:|
|
|
254
|
-
|id|string|The original script ID|-|✅ Required|
|
|
255
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
256
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
257
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
258
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
259
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
260
|
-
|
|
261
|
-
#### `onLoad`
|
|
262
|
-
|
|
263
|
-
Callback executed when the script loads successfully
|
|
264
|
-
|
|
265
|
-
|Property|Type|Description|Default|Required|
|
|
266
|
-
|:--|:--|:--|:--|:--:|
|
|
267
|
-
|id|string|The original script ID|-|✅ Required|
|
|
268
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
269
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
270
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
271
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
272
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
273
|
-
|
|
274
|
-
#### `onError`
|
|
275
|
-
|
|
276
|
-
Callback executed if the script fails to load
|
|
277
|
-
|
|
278
|
-
|Property|Type|Description|Default|Required|
|
|
279
|
-
|:--|:--|:--|:--|:--:|
|
|
280
|
-
|id|string|The original script ID|-|✅ Required|
|
|
281
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
282
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
283
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
284
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
285
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
286
|
-
|
|
287
|
-
#### `onConsentChange`
|
|
288
|
-
|
|
289
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
290
|
-
|
|
291
|
-
|Property|Type|Description|Default|Required|
|
|
292
|
-
|:--|:--|:--|:--|:--:|
|
|
293
|
-
|id|string|The original script ID|-|✅ Required|
|
|
294
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
295
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
296
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
297
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
298
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
225
|
+
|Property|Value|
|
|
226
|
+
|:--|:--|
|
|
227
|
+
|Type Name|\`Script\`|
|
|
228
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
299
229
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|Property|Type|Description|Default|Required|
|
|
303
|
-
|:--|:--|:--|:--|:--:|
|
|
304
|
-
|kind|"c15t.vendor-manifest"|Manifest contract identifier.|-|✅ Required|
|
|
305
|
-
|schemaVersion|1|Manifest schema version.|-|✅ Required|
|
|
306
|
-
|vendor|string|Unique vendor identifier (used as Script.id)|-|✅ Required|
|
|
307
|
-
|category|ManifestCategoryCondition|Consent category or condition required to load this vendor|-|✅ Required|
|
|
308
|
-
|alwaysLoad|string \|boolean \|undefined|Load regardless of consent state (vendor manages its own consent internally)|-|Optional|
|
|
309
|
-
|persistAfterConsentRevoked|string \|boolean \|undefined|Keep script in DOM after consent revocation (vendor has a consent API)|-|Optional|
|
|
310
|
-
|bootstrap|ManifestStep \|undefined|Steps that must execute before default consent signaling. This is primarily used for integrations such as Google tags where a stub global must exist before calling the vendor's consent API.|-|Optional|
|
|
311
|
-
|install|ManifestStep|Steps to execute when installing the vendor.|-|✅ Required|
|
|
312
|
-
|afterLoad|ManifestStep \|undefined|Steps to execute after the main script loads|-|Optional|
|
|
313
|
-
|onBeforeLoadGranted|ManifestStep \|undefined|Steps to execute before load when the vendor has consent|-|Optional|
|
|
314
|
-
|onBeforeLoadDenied|ManifestStep \|undefined|Steps to execute before load when the vendor does not have consent|-|Optional|
|
|
315
|
-
|onLoadGranted|ManifestStep \|undefined|Steps to execute after load when the vendor has consent|-|Optional|
|
|
316
|
-
|onLoadDenied|ManifestStep \|undefined|Steps to execute after load when the vendor does not have consent|-|Optional|
|
|
317
|
-
|onConsentChange|ManifestStep \|undefined|Steps to run on any consent state change|-|Optional|
|
|
318
|
-
|onConsentGranted|ManifestStep \|undefined|Steps to run when this vendor's category consent is granted|-|Optional|
|
|
319
|
-
|onConsentDenied|ManifestStep \|undefined|Steps to run when this vendor's category consent is denied|-|Optional|
|
|
320
|
-
|consentMapping|Record\<string, string\[]> \|undefined|Maps c15t consent categories to vendor-specific consent type names. Used with \`consentSignal\` to translate c15t consent state into the vendor's consent API format.|-|Optional|
|
|
321
|
-
|consentSignal|"gtag" \|undefined|How to signal consent state to the vendor|-|Optional|
|
|
322
|
-
|consentSignalTarget|string \|undefined|Target global for consent signaling (defaults based on signal type)|-|Optional|
|
|
323
|
-
|
|
324
|
-
#### `bootstrap` ManifestStep
|
|
325
|
-
|
|
326
|
-
Steps that must execute before default consent signaling. This is primarily used for integrations such as Google tags where a stub global must exist before calling the vendor's consent API.
|
|
327
|
-
|
|
328
|
-
|Property|Type|Description|Default|Required|
|
|
329
|
-
|:--|:--|:--|:--|:--:|
|
|
330
|
-
|type|Object|-|-|✅ Required|
|
|
331
|
-
|
|
332
|
-
#### `install` ManifestStep
|
|
333
|
-
|
|
334
|
-
Steps to execute when installing the vendor.
|
|
335
|
-
|
|
336
|
-
* If a \`loadScript\` step exists, its \`src\` becomes \`Script.src\`
|
|
337
|
-
* All non-\`loadScript\` steps run as part of \`onBeforeLoad\`
|
|
338
|
-
|
|
339
|
-
|Property|Type|Description|Default|Required|
|
|
340
|
-
|:--|:--|:--|:--|:--:|
|
|
341
|
-
|type|Object|-|-|✅ Required|
|
|
342
|
-
|
|
343
|
-
#### `afterLoad` ManifestStep
|
|
344
|
-
|
|
345
|
-
Steps to execute after the main script loads
|
|
346
|
-
|
|
347
|
-
|Property|Type|Description|Default|Required|
|
|
348
|
-
|:--|:--|:--|:--|:--:|
|
|
349
|
-
|type|Object|-|-|✅ Required|
|
|
350
|
-
|
|
351
|
-
#### `onBeforeLoadGranted` ManifestStep
|
|
352
|
-
|
|
353
|
-
Steps to execute before load when the vendor has consent
|
|
354
|
-
|
|
355
|
-
|Property|Type|Description|Default|Required|
|
|
356
|
-
|:--|:--|:--|:--|:--:|
|
|
357
|
-
|type|Object|-|-|✅ Required|
|
|
358
|
-
|
|
359
|
-
#### `onBeforeLoadDenied` ManifestStep
|
|
230
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
360
231
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|Property|Type|Description|Default|Required|
|
|
364
|
-
|:--|:--|:--|:--|:--:|
|
|
365
|
-
|type|Object|-|-|✅ Required|
|
|
366
|
-
|
|
367
|
-
#### `onLoadGranted` ManifestStep
|
|
368
|
-
|
|
369
|
-
Steps to execute after load when the vendor has consent
|
|
370
|
-
|
|
371
|
-
|Property|Type|Description|Default|Required|
|
|
372
|
-
|:--|:--|:--|:--|:--:|
|
|
373
|
-
|type|Object|-|-|✅ Required|
|
|
374
|
-
|
|
375
|
-
#### `onLoadDenied` ManifestStep
|
|
376
|
-
|
|
377
|
-
Steps to execute after load when the vendor does not have consent
|
|
378
|
-
|
|
379
|
-
|Property|Type|Description|Default|Required|
|
|
380
|
-
|:--|:--|:--|:--|:--:|
|
|
381
|
-
|type|Object|-|-|✅ Required|
|
|
382
|
-
|
|
383
|
-
#### `onConsentChange` ManifestStep
|
|
384
|
-
|
|
385
|
-
Steps to run on any consent state change
|
|
386
|
-
|
|
387
|
-
|Property|Type|Description|Default|Required|
|
|
388
|
-
|:--|:--|:--|:--|:--:|
|
|
389
|
-
|type|Object|-|-|✅ Required|
|
|
390
|
-
|
|
391
|
-
#### `onConsentGranted` ManifestStep
|
|
392
|
-
|
|
393
|
-
Steps to run when this vendor's category consent is granted
|
|
394
|
-
|
|
395
|
-
|Property|Type|Description|Default|Required|
|
|
396
|
-
|:--|:--|:--|:--|:--:|
|
|
397
|
-
|type|Object|-|-|✅ Required|
|
|
398
|
-
|
|
399
|
-
#### `onConsentDenied` ManifestStep
|
|
232
|
+
### VendorManifest
|
|
400
233
|
|
|
401
|
-
|
|
234
|
+
|Property|Value|
|
|
235
|
+
|:--|:--|
|
|
236
|
+
|Type Name|\`VendorManifest\`|
|
|
237
|
+
|Source Path|\`./packages/scripts/src/types.ts\`|
|
|
402
238
|
|
|
403
|
-
|
|
404
|
-
|:--|:--|:--|:--|:--:|
|
|
405
|
-
|type|Object|-|-|✅ Required|
|
|
239
|
+
\*ExtractedTypeTable: Could not extract "VendorManifest" from "./packages/scripts/src/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Clearbit
|
|
3
|
+
description: Visitor and company enrichment loaded with Clearbit's account-keyed
|
|
4
|
+
tags.js snippet.
|
|
5
|
+
group: integrations
|
|
6
|
+
icon: clearbit
|
|
7
|
+
---
|
|
8
|
+
[Clearbit](https://clearbit.com) provides visitor and company enrichment for go-to-market workflows. The official embed loads `https://tag.clearbitscripts.com/v1/{publishableKey}/tags.js` with a `referrerpolicy` of `strict-origin-when-cross-origin`.
|
|
9
|
+
|
|
10
|
+
## Integrate with c15t
|
|
11
|
+
|
|
12
|
+
**React**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
import { ConsentManagerProvider } from '@c15t/react';
|
|
17
|
+
import { clearbit } from '@c15t/scripts/clearbit';
|
|
18
|
+
|
|
19
|
+
const scripts = [
|
|
20
|
+
clearbit({
|
|
21
|
+
publishableKey: 'YOUR_PUBLISHABLE_KEY',
|
|
22
|
+
}),
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export function ConsentProvider({ children }: { children: ReactNode }) {
|
|
26
|
+
return (
|
|
27
|
+
<ConsentManagerProvider
|
|
28
|
+
options={{
|
|
29
|
+
mode: 'hosted',
|
|
30
|
+
backendURL: 'https://your-instance.c15t.dev',
|
|
31
|
+
scripts,
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</ConsentManagerProvider>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Next.js**
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
'use client';
|
|
44
|
+
|
|
45
|
+
import { type ReactNode } from 'react';
|
|
46
|
+
import { ConsentManagerProvider } from '@c15t/nextjs';
|
|
47
|
+
import { clearbit } from '@c15t/scripts/clearbit';
|
|
48
|
+
|
|
49
|
+
const scripts = [
|
|
50
|
+
clearbit({
|
|
51
|
+
publishableKey: 'YOUR_PUBLISHABLE_KEY',
|
|
52
|
+
}),
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
export function ConsentProvider({ children }: { children: ReactNode }) {
|
|
56
|
+
return (
|
|
57
|
+
<ConsentManagerProvider
|
|
58
|
+
options={{
|
|
59
|
+
mode: 'hosted',
|
|
60
|
+
backendURL: '/api/c15t',
|
|
61
|
+
scripts,
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</ConsentManagerProvider>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**JavaScript**
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { getOrCreateConsentRuntime } from 'c15t';
|
|
74
|
+
import { clearbit } from '@c15t/scripts/clearbit';
|
|
75
|
+
|
|
76
|
+
getOrCreateConsentRuntime({
|
|
77
|
+
mode: 'hosted',
|
|
78
|
+
backendURL: 'https://your-instance.c15t.dev',
|
|
79
|
+
scripts: [
|
|
80
|
+
clearbit({
|
|
81
|
+
publishableKey: 'YOUR_PUBLISHABLE_KEY',
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## How c15t loads it
|
|
88
|
+
|
|
89
|
+
* **Category:** `marketing` (Analytics discovery, marketing-sensitive consent)
|
|
90
|
+
* **Loads when:** marketing consent is granted
|
|
91
|
+
* **On revocation:** unloaded — c15t removes the script element from the DOM.
|
|
92
|
+
|
|
93
|
+
Clearbit enrichment tools are privacy-sensitive because they can identify visitors and companies for profiling, enrichment, and intent use cases. The GitHub issue left the category open between measurement and marketing; c15t defaults this integration to `marketing` because enrichment is not just aggregate measurement. The script stays blocked until marketing consent is granted. On revocation c15t removes the script element it created; tags that Clearbit's loader has already appended can keep running until the next page load (c15t reloads the page on revocation by default), so treat the load gate as the consent boundary.
|
|
94
|
+
|
|
95
|
+
The helper maps Clearbit's official snippet:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
clearbit({
|
|
99
|
+
publishableKey: 'YOUR_PUBLISHABLE_KEY',
|
|
100
|
+
})
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
To proxy or self-host the loader, pass a custom URL:
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
clearbit({
|
|
107
|
+
publishableKey: 'YOUR_PUBLISHABLE_KEY',
|
|
108
|
+
scriptUrl: 'https://analytics.example.com/clearbit-tags.js',
|
|
109
|
+
})
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Types
|
|
113
|
+
|
|
114
|
+
### ClearbitOptions
|
|
115
|
+
|
|
116
|
+
|Property|Value|
|
|
117
|
+
|:--|:--|
|
|
118
|
+
|Type Name|\`ClearbitOptions\`|
|
|
119
|
+
|Source Path|\`./packages/scripts/src/vendors/analytics/clearbit.ts\`|
|
|
120
|
+
|
|
121
|
+
\*ExtractedTypeTable: Could not extract "ClearbitOptions" from "./packages/scripts/src/vendors/analytics/clearbit.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
122
|
+
|
|
123
|
+
### Script
|
|
124
|
+
|
|
125
|
+
|Property|Value|
|
|
126
|
+
|:--|:--|
|
|
127
|
+
|Type Name|\`Script\`|
|
|
128
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
129
|
+
|
|
130
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/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: Cloudflare Web Analytics
|
|
3
|
-
description: Cookieless analytics from Cloudflare with a prebuilt helper that
|
|
4
|
-
|
|
3
|
+
description: Cookieless analytics from Cloudflare with a prebuilt helper that
|
|
4
|
+
serializes the beacon config into the `data-cf-beacon` attribute.
|
|
5
|
+
group: integrations
|
|
5
6
|
icon: cloudflare-web-analytics
|
|
6
7
|
---
|
|
7
8
|
Cloudflare Web Analytics is a cookieless analytics product configured through a single `data-cf-beacon` attribute on its loader. The `cloudflareWebAnalytics()` helper serializes your token and single-page application (SPA) preference into that attribute and hands the result to c15t's script loader.
|
|
@@ -108,87 +109,18 @@ Cloudflare Web Analytics has no app-facing event API — the beacon tracks pagev
|
|
|
108
109
|
|
|
109
110
|
### CloudflareWebAnalyticsOptions
|
|
110
111
|
|
|
111
|
-
|Property|
|
|
112
|
-
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
112
|
+
|Property|Value|
|
|
113
|
+
|:--|:--|
|
|
114
|
+
|Type Name|\`CloudflareWebAnalyticsOptions\`|
|
|
115
|
+
|Source Path|\`./packages/scripts/src/vendors/analytics/cloudflare-web-analytics.ts\`|
|
|
116
|
+
|
|
117
|
+
\*ExtractedTypeTable: Could not extract "CloudflareWebAnalyticsOptions" from "./packages/scripts/src/vendors/analytics/cloudflare-web-analytics.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
116
118
|
|
|
117
119
|
### Script
|
|
118
120
|
|
|
119
|
-
|Property|
|
|
120
|
-
|
|
121
|
-
|
|
|
122
|
-
|src
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
126
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
127
|
-
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
128
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
129
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
130
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
131
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
132
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
133
|
-
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
134
|
-
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
135
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
136
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
137
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
138
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
139
|
-
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
140
|
-
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
141
|
-
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
142
|
-
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
143
|
-
|
|
144
|
-
#### `onBeforeLoad`
|
|
145
|
-
|
|
146
|
-
Callback executed before the script is loaded
|
|
147
|
-
|
|
148
|
-
|Property|Type|Description|Default|Required|
|
|
149
|
-
|:--|:--|:--|:--|:--:|
|
|
150
|
-
|id|string|The original script ID|-|✅ Required|
|
|
151
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
152
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
153
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
154
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
155
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
156
|
-
|
|
157
|
-
#### `onLoad`
|
|
158
|
-
|
|
159
|
-
Callback executed when the script loads successfully
|
|
160
|
-
|
|
161
|
-
|Property|Type|Description|Default|Required|
|
|
162
|
-
|:--|:--|:--|:--|:--:|
|
|
163
|
-
|id|string|The original script ID|-|✅ Required|
|
|
164
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
165
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
166
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
167
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
168
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
169
|
-
|
|
170
|
-
#### `onError`
|
|
171
|
-
|
|
172
|
-
Callback executed if the script fails to load
|
|
173
|
-
|
|
174
|
-
|Property|Type|Description|Default|Required|
|
|
175
|
-
|:--|:--|:--|:--|:--:|
|
|
176
|
-
|id|string|The original script ID|-|✅ Required|
|
|
177
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
178
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
179
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
180
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
181
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
182
|
-
|
|
183
|
-
#### `onConsentChange`
|
|
184
|
-
|
|
185
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
186
|
-
|
|
187
|
-
|Property|Type|Description|Default|Required|
|
|
188
|
-
|:--|:--|:--|:--|:--:|
|
|
189
|
-
|id|string|The original script ID|-|✅ Required|
|
|
190
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
191
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
192
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
193
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
194
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
121
|
+
|Property|Value|
|
|
122
|
+
|:--|:--|
|
|
123
|
+
|Type Name|\`Script\`|
|
|
124
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
125
|
+
|
|
126
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/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,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Crisp
|
|
3
3
|
description: Load Crisp live chat with website ID, runtime, cookie, and session options.
|
|
4
|
-
|
|
4
|
+
group: integrations
|
|
5
5
|
icon: crisp
|
|
6
6
|
---
|
|
7
7
|
Crisp adds the Crisp live chat widget and exposes the `$crisp` queue for
|
|
@@ -123,92 +123,18 @@ your backend and set it with Crisp's `$crisp` API after the helper loads.
|
|
|
123
123
|
|
|
124
124
|
### CrispOptions
|
|
125
125
|
|
|
126
|
-
|Property|
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|tokenId|string \|undefined|Optional Crisp token ID for session continuity.|-|Optional|
|
|
133
|
-
|sessionMerge|boolean \|undefined|Whether to merge anonymous sessions into token-backed sessions.|-|Optional|
|
|
134
|
-
|safeMode|boolean \|undefined|Whether to enable \`$crisp\` safe mode before other queued calls.|-|Optional|
|
|
135
|
-
|scriptSrc|string \|undefined|Crisp loader URL.|-|Optional|
|
|
126
|
+
|Property|Value|
|
|
127
|
+
|:--|:--|
|
|
128
|
+
|Type Name|\`CrispOptions\`|
|
|
129
|
+
|Source Path|\`./packages/scripts/src/vendors/functional/crisp.ts\`|
|
|
130
|
+
|
|
131
|
+
\*ExtractedTypeTable: Could not extract "CrispOptions" from "./packages/scripts/src/vendors/functional/crisp.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|
|
136
132
|
|
|
137
133
|
### Script
|
|
138
134
|
|
|
139
|
-
|Property|
|
|
140
|
-
|
|
141
|
-
|
|
|
142
|
-
|src
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|callbackOnly|boolean \|undefined|Whether this is a callback-only script that doesn't need to load an external resource. When true, no script tag will be added to the DOM, only callbacks will be executed.|false|Optional|
|
|
146
|
-
|persistAfterConsentRevoked|boolean \|undefined|Whether the script should persist after consent is revoked.|false|Optional|
|
|
147
|
-
|alwaysLoad|boolean \|undefined|Whether the script should always load regardless of consent state. This is useful for scripts like Google Tag Manager or PostHog that manage their own consent state internally. The script will load immediately and never be unloaded based on consent changes. Note: When using this option, you are responsible for ensuring the script itself respects user consent preferences through its own consent management.|false|Optional|
|
|
148
|
-
|fetchPriority|"high" \|"low" \|"auto" \|undefined|Priority hint for browser resource loading|-|Optional|
|
|
149
|
-
|attributes|Record\<string, string> \|undefined|Additional attributes to add to the script element|-|Optional|
|
|
150
|
-
|async|boolean \|undefined|Whether to use async loading|-|Optional|
|
|
151
|
-
|defer|boolean \|undefined|Whether to defer script loading|-|Optional|
|
|
152
|
-
|nonce|string \|undefined|Content Security Policy nonce|-|Optional|
|
|
153
|
-
|anonymizeId|boolean \|undefined|Whether to use an anonymized ID for the script element, this helps ensure the script is not blocked by ad blockers|true|Optional|
|
|
154
|
-
|target|"head" \|"body" \|undefined|Where to inject the script element in the DOM. Options: \`'head'\`: Scripts are appended to \`\<head>\` (default); \`'body'\`: Scripts are appended to \`\<body>\`|'head'|Optional|
|
|
155
|
-
|onBeforeLoad|Object \|undefined|Callback executed before the script is loaded|-|Optional|
|
|
156
|
-
|onLoad|Object \|undefined|Callback executed when the script loads successfully|-|Optional|
|
|
157
|
-
|onError|Object \|undefined|Callback executed if the script fails to load|-|Optional|
|
|
158
|
-
|onConsentChange|Object \|undefined|Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.|-|Optional|
|
|
159
|
-
|vendorId|string \|number \|undefined|IAB TCF vendor ID - links script to a registered vendor. When in IAB mode, the script will only load if this vendor has consent. Takes precedence over \`category\` when in IAB mode. Use custom vendor IDs (string or number) to gate non-IAB vendors too.|-|Optional|
|
|
160
|
-
|iabPurposes|number\[] \|undefined|IAB TCF purpose IDs this script requires consent for. When in IAB mode and no vendorId is set, the script will only load if ALL specified purposes have consent.|-|Optional|
|
|
161
|
-
|iabLegIntPurposes|number\[] \|undefined|IAB TCF legitimate interest purpose IDs. These purposes can operate under legitimate interest instead of consent. The script loads if all iabPurposes have consent OR all iabLegIntPurposes have legitimate interest established.|-|Optional|
|
|
162
|
-
|iabSpecialFeatures|number\[] \|undefined|IAB TCF special feature IDs this script requires. Options: 1: Use precise geolocation data; 2: Actively scan device characteristics for identification|-|Optional|
|
|
163
|
-
|
|
164
|
-
#### `onBeforeLoad`
|
|
165
|
-
|
|
166
|
-
Callback executed before the script is loaded
|
|
167
|
-
|
|
168
|
-
|Property|Type|Description|Default|Required|
|
|
169
|
-
|:--|:--|:--|:--|:--:|
|
|
170
|
-
|id|string|The original script ID|-|✅ Required|
|
|
171
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
172
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
173
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
174
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
175
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
176
|
-
|
|
177
|
-
#### `onLoad`
|
|
178
|
-
|
|
179
|
-
Callback executed when the script loads successfully
|
|
180
|
-
|
|
181
|
-
|Property|Type|Description|Default|Required|
|
|
182
|
-
|:--|:--|:--|:--|:--:|
|
|
183
|
-
|id|string|The original script ID|-|✅ Required|
|
|
184
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
185
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
186
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
187
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
188
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
189
|
-
|
|
190
|
-
#### `onError`
|
|
191
|
-
|
|
192
|
-
Callback executed if the script fails to load
|
|
193
|
-
|
|
194
|
-
|Property|Type|Description|Default|Required|
|
|
195
|
-
|:--|:--|:--|:--|:--:|
|
|
196
|
-
|id|string|The original script ID|-|✅ Required|
|
|
197
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
198
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
199
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
200
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
201
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
202
|
-
|
|
203
|
-
#### `onConsentChange`
|
|
204
|
-
|
|
205
|
-
Callback executed whenever the consent store is changed. This callback only applies to scripts already loaded.
|
|
206
|
-
|
|
207
|
-
|Property|Type|Description|Default|Required|
|
|
208
|
-
|:--|:--|:--|:--|:--:|
|
|
209
|
-
|id|string|The original script ID|-|✅ Required|
|
|
210
|
-
|elementId|string|The actual DOM element ID used (anonymized if enabled)|-|✅ Required|
|
|
211
|
-
|hasConsent|boolean|Has consent|-|✅ Required|
|
|
212
|
-
|consents|ConsentState|The current consent state|-|✅ Required|
|
|
213
|
-
|element|HTMLScriptElement \|undefined|The script element (for load/error callbacks) Will be undefined for callback-only scripts|-|Optional|
|
|
214
|
-
|error|Error \|undefined|Error information (for error callbacks)|-|Optional|
|
|
135
|
+
|Property|Value|
|
|
136
|
+
|:--|:--|
|
|
137
|
+
|Type Name|\`Script\`|
|
|
138
|
+
|Source Path|\`./packages/core/src/libs/script-loader/types.ts\`|
|
|
139
|
+
|
|
140
|
+
\*ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/home/runner/work/c15t/c15t". Verify the path/name and that the file is included by your tsconfig.\*
|