@c15t/scripts 2.2.0 → 2.3.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.
@@ -0,0 +1,66 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ import { resolveScriptUrl, trimToUndefined } from "../_shared/script-url.js";
4
+ const FRONT_CHAT_SCRIPT_SRC = 'https://chat-assets.frontapp.com/v1/chat.bundle.js';
5
+ const frontChatManifest = {
6
+ ...vendorManifestContract,
7
+ vendor: 'front-chat',
8
+ category: 'functionality',
9
+ install: [
10
+ {
11
+ type: 'loadScript',
12
+ src: "{{scriptSrc}}",
13
+ async: true
14
+ }
15
+ ],
16
+ onLoadGranted: [
17
+ {
18
+ type: 'callGlobal',
19
+ global: 'FrontChat',
20
+ args: [
21
+ 'init',
22
+ '{{initOptions}}'
23
+ ]
24
+ }
25
+ ]
26
+ };
27
+ function frontChat(options) {
28
+ const chatId = 'string' == typeof options?.chatId ? options.chatId.trim() : '';
29
+ if (!chatId) throw new Error('frontChat: chatId must be a non-empty string.');
30
+ const scriptSrc = resolveScriptUrl(trimToUndefined(options.scriptSrc), FRONT_CHAT_SCRIPT_SRC);
31
+ const nonce = trimToUndefined(options.nonce);
32
+ const initOptions = {
33
+ chatId,
34
+ useDefaultLauncher: options.useDefaultLauncher ?? true,
35
+ ...nonce ? {
36
+ nonce
37
+ } : {}
38
+ };
39
+ const script = resolveManifest(frontChatManifest, {
40
+ scriptSrc,
41
+ initOptions
42
+ });
43
+ return {
44
+ ...script,
45
+ target: 'body',
46
+ nonce,
47
+ onLoad (info) {
48
+ if (!info.hasConsent || !info.element?.isConnected) return;
49
+ const loadedNonce = info.element.nonce;
50
+ const resolved = loadedNonce ? resolveManifest(frontChatManifest, {
51
+ scriptSrc,
52
+ initOptions: {
53
+ ...initOptions,
54
+ nonce: loadedNonce
55
+ }
56
+ }) : script;
57
+ resolved.onLoad?.(info);
58
+ }
59
+ };
60
+ }
61
+ function shutdownFrontChat() {
62
+ if ("u" > typeof window && 'function' == typeof window.FrontChat) window.FrontChat('shutdown', {
63
+ clearSession: true
64
+ });
65
+ }
66
+ export { frontChat, frontChatManifest, shutdownFrontChat };
@@ -1,5 +1,5 @@
1
1
  import type { ConsentState, Script, ScriptCallbackInfo } from 'c15t';
2
- import { type BuiltInScriptIntegrationKey } from '../registry';
2
+ import { type BuiltInScriptIntegrationKey } from '../registry.js';
3
3
  /**
4
4
  * Typed view of `globalThis` used by script helper tests.
5
5
  *
@@ -1,3 +1,3 @@
1
- import type { ResolvedManifest, VendorManifest } from '../types';
1
+ import type { ResolvedManifest, VendorManifest } from '../types.js';
2
2
  export declare function interpolateValue(value: unknown, config: Record<string, unknown>): unknown;
3
3
  export declare function compileManifest(manifest: VendorManifest, config?: Record<string, unknown>): ResolvedManifest;
@@ -1,3 +1,3 @@
1
1
  import { type Script } from 'c15t';
2
- import { type ResolvedManifest } from '../types';
2
+ import { type ResolvedManifest } from '../types.js';
3
3
  export declare function resolvedManifestToScript(resolvedManifest: ResolvedManifest): Script;
@@ -229,6 +229,15 @@ export declare const builtInScriptIntegrations: readonly [{
229
229
  readonly packageSubpath: 'matomo-analytics';
230
230
  readonly integrationCategory: 'analytics';
231
231
  readonly consentCategory: 'measurement';
232
+ }, {
233
+ readonly key: 'oneDollarStats';
234
+ readonly vendor: 'one-dollar-stats';
235
+ readonly label: 'OneDollarStats';
236
+ readonly hint: 'Website analytics with no API key';
237
+ readonly docsSlug: 'one-dollar-stats';
238
+ readonly packageSubpath: 'one-dollar-stats';
239
+ readonly integrationCategory: 'analytics';
240
+ readonly consentCategory: 'measurement';
232
241
  }, {
233
242
  readonly key: 'posthog';
234
243
  readonly vendor: 'posthog';
@@ -310,6 +319,15 @@ export declare const builtInScriptIntegrations: readonly [{
310
319
  readonly packageSubpath: 'crisp';
311
320
  readonly integrationCategory: 'functional';
312
321
  readonly consentCategory: 'functionality';
322
+ }, {
323
+ readonly key: 'frontChat';
324
+ readonly vendor: 'front-chat';
325
+ readonly label: 'Front Chat';
326
+ readonly hint: 'Live chat widget';
327
+ readonly docsSlug: 'front-chat';
328
+ readonly packageSubpath: 'front-chat';
329
+ readonly integrationCategory: 'functional';
330
+ readonly consentCategory: 'functionality';
313
331
  }, {
314
332
  readonly key: 'intercom';
315
333
  readonly vendor: 'intercom';
@@ -382,6 +400,15 @@ export declare const builtInScriptIntegrations: readonly [{
382
400
  readonly packageSubpath: 'x-pixel';
383
401
  readonly integrationCategory: 'ads-and-pixels';
384
402
  readonly consentCategory: 'marketing';
403
+ }, {
404
+ readonly key: 'pinterestTag';
405
+ readonly vendor: 'pinterest-tag';
406
+ readonly label: 'Pinterest Tag';
407
+ readonly hint: 'Pinterest ads tracking';
408
+ readonly docsSlug: 'pinterest-tag';
409
+ readonly packageSubpath: 'pinterest-tag';
410
+ readonly integrationCategory: 'ads-and-pixels';
411
+ readonly consentCategory: 'marketing';
385
412
  }];
386
413
  /**
387
414
  * Concrete registry entry type inferred from `builtInScriptIntegrations`.
@@ -1,5 +1,5 @@
1
1
  import type { Script } from 'c15t';
2
- import type { VendorManifest } from './types';
2
+ import type { VendorManifest } from './types.js';
3
3
  /**
4
4
  * Compiles a `VendorManifest` + config into a `Script` object.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { VendorManifest } from '../../types';
1
+ import type { VendorManifest } from '../../types.js';
2
2
  /**
3
3
  * Optional tracking call inserted between the vendor init call and script load.
4
4
  */
@@ -0,0 +1,295 @@
1
+ import type { Script } from 'c15t';
2
+ /**
3
+ * The 20 Pinterest Tag event types accepted by `pintrk('track', ...)`.
4
+ *
5
+ * Conversion tracking and reporting require one of these names. Any other
6
+ * string is treated as a user-defined event, which Pinterest makes available
7
+ * for audience targeting only.
8
+ *
9
+ * @see {@link https://help.pinterest.com/en/business/article/add-event-codes} Add event codes
10
+ */
11
+ export type PinterestTagEventName = 'pagevisit' | 'viewcategory' | 'search' | 'addtocart' | 'checkout' | 'watchvideo' | 'signup' | 'lead' | 'custom' | 'addpaymentinfo' | 'addtowishlist' | 'initiatecheckout' | 'subscribe' | 'viewcontent' | 'contact' | 'schedule' | 'findlocation' | 'customizeproduct' | 'submitapplication' | 'starttrial';
12
+ /**
13
+ * A product entry in `PinterestTagEventData.line_items`.
14
+ *
15
+ * Pinterest reads product-level details from `line_items`, not from the
16
+ * top level of the event data.
17
+ */
18
+ export interface PinterestTagLineItem {
19
+ /** Product name, for example `Parker Boots`. */
20
+ product_name?: string;
21
+ /** Product identifier or SKU. */
22
+ product_id?: string;
23
+ /** Product category, for example `Shoes`. */
24
+ product_category?: string;
25
+ /** Variant identifier, for example `1414-Red`. */
26
+ product_variant_id?: string;
27
+ /** Human-readable variant, for example `Red`. */
28
+ product_variant?: string;
29
+ /** Unit price of the product. */
30
+ product_price?: number;
31
+ /** Quantity of this product in the event. */
32
+ product_quantity?: number;
33
+ /** Brand name. */
34
+ product_brand?: string;
35
+ [key: string]: unknown;
36
+ }
37
+ /**
38
+ * Currency codes Pinterest accepts in `PinterestTagEventData.currency`.
39
+ *
40
+ * Pinterest converts the reported value to your advertiser account currency.
41
+ */
42
+ export type PinterestTagCurrency = 'AED' | 'AMD' | 'ARS' | 'AUD' | 'AZN' | 'BAM' | 'BGN' | 'BHD' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'CAD' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CZK' | 'DKK' | 'DOP' | 'EGP' | 'EUR' | 'FJD' | 'GBP' | 'GEL' | 'GIP' | 'HKD' | 'HNL' | 'HRK' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'ISK' | 'JMD' | 'JPY' | 'KGS' | 'KRW' | 'KWD' | 'KZT' | 'MAD' | 'MDL' | 'MOP' | 'MXN' | 'MYR' | 'NOK' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PHP' | 'PKR' | 'PLN' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'SAR' | 'SEK' | 'SGD' | 'THB' | 'TRY' | 'TWD' | 'UAH' | 'USD' | 'UYU' | 'VND' | 'ZAR';
43
+ /**
44
+ * Event data accepted by `pintrk('track', ...)`.
45
+ *
46
+ * Pinterest documents the same field set for every event type; which fields
47
+ * are meaningful depends on the event. All event data is available for
48
+ * audience targeting, but only `value` and `order_quantity` appear in paid
49
+ * and organic conversion reporting. Any additional keys are forwarded
50
+ * unchanged.
51
+ */
52
+ export interface PinterestTagEventData {
53
+ /**
54
+ * Unique event identifier used to deduplicate against Conversions API
55
+ * events. Pinterest also accepts this under `eventID` or `eid`.
56
+ */
57
+ event_id?: string;
58
+ /** Case-sensitive alias for `event_id`. */
59
+ eventID?: string;
60
+ /** Case-sensitive alias for `event_id`. */
61
+ eid?: string;
62
+ /**
63
+ * Total monetary value for commerce events such as `checkout`.
64
+ *
65
+ * Available in conversion reporting.
66
+ */
67
+ value?: number;
68
+ /**
69
+ * Total number of items in the order.
70
+ *
71
+ * Available in conversion reporting.
72
+ */
73
+ order_quantity?: number;
74
+ /**
75
+ * Currency code for `value`, for example `USD`. Required for `addtocart`
76
+ * and `checkout` in catalog sales campaigns.
77
+ */
78
+ currency?: PinterestTagCurrency | (string & {});
79
+ /**
80
+ * Order identifier for `checkout` events. Required for conversion
81
+ * analysis reporting.
82
+ */
83
+ order_id?: string;
84
+ /** Promo code applied to the order. */
85
+ promo_code?: string;
86
+ /** Property or store name, for example `Athleta`. */
87
+ property?: string;
88
+ /** Query text for `search` events. */
89
+ search_query?: string;
90
+ /** Video title for `watchvideo` events. */
91
+ video_title?: string;
92
+ /** Lead type for `lead` events, for example `Newsletter`. */
93
+ lead_type?: string;
94
+ /** Products associated with the event. */
95
+ line_items?: PinterestTagLineItem[];
96
+ [key: string]: unknown;
97
+ }
98
+ /**
99
+ * Options passed as the third argument to `pintrk('load', tagId, options)`.
100
+ */
101
+ export interface PinterestTagLoadOptions {
102
+ /**
103
+ * Email address (plain or SHA-256 hashed) for Pinterest enhanced match.
104
+ *
105
+ * Only provide this when your application has separately obtained the
106
+ * appropriate user consent to share it with Pinterest.
107
+ */
108
+ em?: string;
109
+ /**
110
+ * Hashed external user identifier used by Pinterest for attribution.
111
+ */
112
+ external_id?: string;
113
+ [key: string]: unknown;
114
+ }
115
+ /**
116
+ * Optional callback passed as the last argument to `pintrk('track', ...)`.
117
+ *
118
+ * @param didInit - `true` when Pinterest constructed the event call
119
+ * successfully, `false` when it detected an error.
120
+ * @param error - Error description when `didInit` is `false`, otherwise
121
+ * `undefined`.
122
+ */
123
+ export type PinterestTagEventCallback = (didInit: boolean, error?: string) => void;
124
+ type PinterestTagFunction = {
125
+ (command: 'load', tagId: string, options?: PinterestTagLoadOptions): void;
126
+ (command: 'page'): void;
127
+ (command: 'track', eventName: PinterestTagEventName | (string & {}), eventData?: PinterestTagEventData, callback?: PinterestTagEventCallback): void;
128
+ (command: 'setconsent', consent: boolean): void;
129
+ (command: 'set', data: Record<string, unknown>): void;
130
+ (command: string, ...args: unknown[]): void;
131
+ };
132
+ declare global {
133
+ interface Window {
134
+ pintrk?: PinterestTagFunction & {
135
+ queue?: unknown[][];
136
+ version?: string;
137
+ };
138
+ }
139
+ }
140
+ /**
141
+ * Pinterest Tag vendor manifest.
142
+ *
143
+ * Mirrors Pinterest's v3 base code: a `pintrk` stub that pushes argument
144
+ * arrays onto `pintrk.queue`, `pintrk.version = "3.0"`, then the async
145
+ * `core.js` loader.
146
+ *
147
+ * Pinterest exposes a runtime consent API via `pintrk('setconsent', boolean)`.
148
+ * `setconsent(false)` stops events and clears Pinterest's first-party
149
+ * storage, so the script persists after consent revocation and receives the
150
+ * updated consent state instead of being removed from the document.
151
+ */
152
+ export declare const pinterestTagManifest: {
153
+ readonly kind: "c15t.vendor-manifest";
154
+ readonly schemaVersion: 1;
155
+ readonly vendor: 'pinterest-tag';
156
+ readonly category: 'marketing';
157
+ readonly persistAfterConsentRevoked: true;
158
+ readonly bootstrap: [{
159
+ readonly type: 'defineStubFunction';
160
+ readonly name: 'pintrk';
161
+ readonly queue: {
162
+ readonly property: 'queue';
163
+ };
164
+ readonly queueFormat: 'array';
165
+ readonly properties: {
166
+ readonly version: '3.0';
167
+ };
168
+ readonly ifUndefined: true;
169
+ }];
170
+ readonly install: [{
171
+ readonly type: 'callGlobal';
172
+ readonly global: 'pintrk';
173
+ readonly args: ["load", "{{tagId}}"];
174
+ }, {
175
+ readonly type: 'callGlobal';
176
+ readonly global: 'pintrk';
177
+ readonly args: ["setconsent", true];
178
+ }, {
179
+ readonly type: 'callGlobal';
180
+ readonly global: 'pintrk';
181
+ readonly args: ["page"];
182
+ }, {
183
+ readonly type: 'loadScript';
184
+ readonly src: '{{scriptUrl}}';
185
+ readonly async: true;
186
+ }];
187
+ readonly onConsentGranted: [{
188
+ readonly type: 'callGlobal';
189
+ readonly global: 'pintrk';
190
+ readonly args: ["setconsent", true];
191
+ }];
192
+ readonly onConsentDenied: [{
193
+ readonly type: 'callGlobal';
194
+ readonly global: 'pintrk';
195
+ readonly args: ["setconsent", false];
196
+ }];
197
+ };
198
+ export interface PinterestTagOptions {
199
+ /**
200
+ * Your Pinterest Tag ID.
201
+ * @example `2613654212508`
202
+ */
203
+ tagId: string;
204
+ /**
205
+ * Optional payload passed to `pintrk('load', tagId, loadOptions)`, for
206
+ * example enhanced match values.
207
+ *
208
+ * Do not provide user identifiers unless the appropriate consent and
209
+ * privacy requirements have already been satisfied.
210
+ */
211
+ loadOptions?: PinterestTagLoadOptions;
212
+ /**
213
+ * Queue the default `pintrk('page')` page-visit event during setup.
214
+ * @default true
215
+ */
216
+ trackPageVisit?: boolean;
217
+ /** Pinterest Tag loader URL. */
218
+ scriptUrl?: string;
219
+ }
220
+ /**
221
+ * Creates a Pinterest Tag script.
222
+ *
223
+ * This script persists after consent is revoked because Pinterest exposes
224
+ * `pintrk('setconsent', boolean)`, which lets c15t disable tracking and clear
225
+ * Pinterest's first-party storage without removing the script element.
226
+ *
227
+ * @param options.tagId - Pinterest Tag ID used in `pintrk('load', ...)`.
228
+ * Numeric string from Pinterest Ads Manager, for example `'2613654212508'`.
229
+ * @param options.loadOptions - Optional object passed as the third argument to
230
+ * `pintrk('load', tagId, loadOptions)`, for example `{ em: 'user@example.com' }`.
231
+ * @param options.trackPageVisit - Whether to queue the default `pintrk('page')`
232
+ * call during setup. Defaults to `true`.
233
+ * @param options.scriptUrl - Override for Pinterest's `core.js` loader URL.
234
+ * @returns A resolved c15t `Script` configuration that defines the `pintrk`
235
+ * queue stub, queues `load`, `setconsent`, and optionally `page`, then loads
236
+ * Pinterest's `core.js`.
237
+ *
238
+ * @example
239
+ * ```ts
240
+ * const script = pinterestTag({
241
+ * tagId: '2613654212508',
242
+ * loadOptions: { em: 'user@example.com' },
243
+ * trackPageVisit: false,
244
+ * });
245
+ * ```
246
+ *
247
+ * @see {@link https://help.pinterest.com/en/business/article/install-the-pinterest-tag} Pinterest Tag documentation
248
+ */
249
+ export declare function pinterestTag({ tagId, loadOptions, trackPageVisit, scriptUrl, }: PinterestTagOptions): Script;
250
+ /**
251
+ * Tracks a Pinterest Tag event.
252
+ *
253
+ * This helper is a no-op until Pinterest has been initialized by c15t, so it
254
+ * is safe to call before marketing consent is granted. It does not bypass
255
+ * consent: after revocation Pinterest's own `setconsent(false)` state
256
+ * suppresses the event.
257
+ *
258
+ * @param eventName - One of Pinterest's 20 event types or a user-defined
259
+ * event name.
260
+ * @param eventData - Optional event data, including `event_id` for Tag plus
261
+ * Conversions API deduplication.
262
+ * @param callback - Optional `(didInit, error)` callback Pinterest invokes
263
+ * after constructing the event call. Useful for surfacing tag errors in
264
+ * development.
265
+ *
266
+ * @example
267
+ * ```ts
268
+ * pinterestTagEvent('checkout', {
269
+ * event_id: 'event-123',
270
+ * value: 99.99,
271
+ * order_quantity: 1,
272
+ * currency: 'USD',
273
+ * order_id: 'order-123',
274
+ * line_items: [
275
+ * {
276
+ * product_name: 'Parker Boots',
277
+ * product_id: '1414',
278
+ * product_price: 99.99,
279
+ * product_quantity: 1,
280
+ * },
281
+ * ],
282
+ * });
283
+ * ```
284
+ *
285
+ * @example
286
+ * ```ts
287
+ * pinterestTagEvent('lead', { lead_type: 'Newsletter' }, (didInit, error) => {
288
+ * if (!didInit) {
289
+ * console.error(error);
290
+ * }
291
+ * });
292
+ * ```
293
+ */
294
+ export declare const pinterestTagEvent: (eventName: PinterestTagEventName | (string & {}), eventData?: PinterestTagEventData, callback?: PinterestTagEventCallback) => void;
295
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { Script } from 'c15t';
2
- import { type VendorManifest } from '../../types';
2
+ import { type VendorManifest } from '../../types.js';
3
3
  declare global {
4
4
  interface Window {
5
5
  adobeDataLayer?: unknown[];
@@ -1,5 +1,5 @@
1
1
  import type { Script } from 'c15t';
2
- import { type VendorManifest } from '../../types';
2
+ import { type VendorManifest } from '../../types.js';
3
3
  declare global {
4
4
  interface Window {
5
5
  _paq?: unknown[];
@@ -0,0 +1,38 @@
1
+ import type { Script } from 'c15t';
2
+ /** The classic script from OneDollarStats' installation instructions. */
3
+ export declare const ONE_DOLLAR_STATS_SCRIPT_SRC = "https://assets.onedollarstats.com/stonks.js";
4
+ /** OneDollarStats is loaded only after measurement consent is granted. */
5
+ export declare const oneDollarStatsManifest: {
6
+ readonly kind: "c15t.vendor-manifest";
7
+ readonly schemaVersion: 1;
8
+ readonly vendor: 'one-dollar-stats';
9
+ readonly category: 'measurement';
10
+ readonly install: [{
11
+ readonly type: 'loadScript';
12
+ readonly src: "https://assets.onedollarstats.com/stonks.js";
13
+ readonly defer: true;
14
+ }];
15
+ };
16
+ export interface OneDollarStatsOptions {
17
+ /**
18
+ * Bare hostname, such as `docs.example.com`. Overrides the event hostname
19
+ * on every host, including production. Required for local dev mode.
20
+ */
21
+ hostname?: string;
22
+ /**
23
+ * Tracker settings forwarded as `data-*` attributes. Use string values,
24
+ * e.g. `devmode: 'true'`, `autocollect: 'false'`, or a custom `url`.
25
+ * Setting `'hash-routing': 'false'` omits the presence-based attribute.
26
+ */
27
+ [setting: string]: string | undefined;
28
+ }
29
+ /**
30
+ * Creates a consent-gated OneDollarStats script. No API key is required.
31
+ * The tracker reads data attributes from `document.currentScript` and
32
+ * handles client-side navigation itself.
33
+ *
34
+ * @param options - Tracker settings without the `data-` prefix.
35
+ * @returns The OneDollarStats script configuration.
36
+ * @throws When hostname is not a bare host or a setting is not a string.
37
+ */
38
+ export declare function oneDollarStats(options?: OneDollarStatsOptions): Script;
@@ -0,0 +1,61 @@
1
+ import type { Script } from 'c15t';
2
+ declare global {
3
+ interface Window {
4
+ FrontChat?: (command: string, options?: Record<string, unknown>) => unknown;
5
+ }
6
+ }
7
+ /** Front Chat loader and consent-gated widget initialisation. */
8
+ export declare const frontChatManifest: {
9
+ readonly kind: "c15t.vendor-manifest";
10
+ readonly schemaVersion: 1;
11
+ readonly vendor: 'front-chat';
12
+ readonly category: 'functionality';
13
+ readonly install: [{
14
+ readonly type: 'loadScript';
15
+ readonly src: '{{scriptSrc}}';
16
+ readonly async: true;
17
+ }];
18
+ readonly onLoadGranted: [{
19
+ readonly type: 'callGlobal';
20
+ readonly global: 'FrontChat';
21
+ readonly args: ["init", "{{initOptions}}"];
22
+ }];
23
+ };
24
+ export interface FrontChatOptions {
25
+ /** Public chat ID from the Front channel's installation snippet. */
26
+ chatId: string;
27
+ /** Show Front's default launcher. @default true */
28
+ useDefaultLauncher?: boolean;
29
+ /** Custom or proxied Front Chat bundle URL. */
30
+ scriptSrc?: string;
31
+ /** CSP nonce forwarded to the loader and Front's generated scripts. */
32
+ nonce?: string;
33
+ }
34
+ /**
35
+ * Creates a Front Chat script gated on functionality consent.
36
+ *
37
+ * Keep c15t's default reload-on-revocation behaviour enabled to stop an
38
+ * already-running widget. Removing its loader cannot unload the SDK.
39
+ *
40
+ * @param options - Front channel and launcher configuration.
41
+ * @returns The Front Chat script configuration.
42
+ * @throws {Error} When chatId is missing or empty. Copy the public ID from
43
+ * the Front channel's installation snippet.
44
+ * @example
45
+ * frontChat({ chatId: 'YOUR_FRONT_CHAT_ID' });
46
+ * @see https://help.front.com/en/articles/2049
47
+ */
48
+ export declare function frontChat(options: FrontChatOptions): Script;
49
+ /**
50
+ * Requests widget removal and session cleanup through Front's SDK.
51
+ *
52
+ * Optionally call before c15t's revocation reload. Front does not provide a
53
+ * completion promise, so this does not guarantee cleanup before navigation.
54
+ * Safe to call during SSR or before the SDK loads.
55
+ *
56
+ * @returns Nothing.
57
+ * @example
58
+ * shutdownFrontChat();
59
+ * @see https://dev.frontapp.com/docs/chat-sdk-reference
60
+ */
61
+ export declare function shutdownFrontChat(): void;
package/docs/README.md CHANGED
@@ -25,6 +25,7 @@ Connect analytics, advertising, maps, media, and other third-party tools behind
25
25
  - [Crisp](./integrations/crisp.md): Load Crisp live chat with website ID, runtime, cookie, and session options.
26
26
  - [Databuddy](./integrations/databuddy.md): Databuddy is a privacy-focused analytics platform that helps you understand user behavior and track events. It supports cookieless tracking and manages consent automatically through c15t's consent state synchronization.
27
27
  - [Fathom Analytics](./integrations/fathom-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that maps Fathom's data attributes into a c15t-managed script.
28
+ - [Front Chat](./integrations/front-chat.md): Load Front Chat after functionality consent and initialize the widget when its SDK is ready.
28
29
  - [Google Maps](./integrations/google-maps.md): Render Google Maps only after consent with one shared Maps JavaScript API loader and independently managed map instances.
29
30
  - [GA4 + Google Ads (gtag.js)](./integrations/google-tag.md): Send data to Google Analytics 4 and Google Ads with automatic Consent Mode v2 support.
30
31
  - [Google Tag Manager](./integrations/google-tag-manager.md): Deploy and manage marketing tags centrally with automatic consent state synchronization.
@@ -39,7 +40,9 @@ Connect analytics, advertising, maps, media, and other third-party tools behind
39
40
  - [Microsoft Clarity](./integrations/microsoft-clarity.md): Session replay and behavior analytics with a prebuilt helper that keeps Clarity consent synchronized with c15t measurement state.
40
41
  - [Microsoft UET](./integrations/microsoft-uet.md): Track conversions and measure performance for Microsoft Advertising and Bing Ads.
41
42
  - [Mixpanel Analytics](./integrations/mixpanel-analytics.md): Load Mixpanel with c15t and let Mixpanel's own opt-in and opt-out APIs follow measurement consent.
43
+ - [OneDollarStats](./integrations/one-dollar-stats.md): Load OneDollarStats after measurement consent with optional tracker data attributes.
42
44
  - [Integrations](./integrations/overview.md): Load analytics, pixels, tag managers, and widgets through c15t so consent state controls when they run, update, and appear in your consent UI.
45
+ - [Pinterest Tag](./integrations/pinterest-tag.md): Track conversions and build audiences for Pinterest advertising campaigns.
43
46
  - [Pirsch](./integrations/pirsch.md): Privacy-friendly, cookieless analytics loaded with Pirsch's fixed script id and identification-code attributes.
44
47
  - [Plausible Analytics](./integrations/plausible-analytics.md): Privacy-friendly cookieless analytics with a prebuilt helper that preserves Plausible's queue bootstrap and loader attributes.
45
48
  - [PostHog](./integrations/posthog.md): PostHog is an open-source product analytics platform for tracking user behavior, session replays, feature flags, and A/B testing. It supports cookieless tracking, allowing analytics to continue even without cookie consent.