@c15t/scripts 2.1.0 → 2.2.0-canary-20260804162155
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 +62 -0
- package/README.md +32 -20
- package/dist/e2e-test-utils.cjs +51 -10
- package/dist/e2e-test-utils.js +37 -3
- package/dist/engine/compile.cjs +9 -5
- package/dist/engine/runtime.cjs +103 -17
- package/dist/engine/runtime.js +94 -12
- package/dist/registry.cjs +97 -12
- package/dist/registry.js +80 -0
- package/dist/resolve.cjs +9 -5
- package/dist/types.cjs +17 -13
- package/dist/vendors/_shared/attributes.cjs +13 -9
- package/dist/vendors/_shared/google-consent.cjs +14 -9
- package/dist/vendors/_shared/install-builders.cjs +12 -8
- package/dist/vendors/_shared/script-url.cjs +16 -12
- package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +9 -5
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +13 -9
- package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +11 -7
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +9 -5
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +11 -7
- package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +9 -5
- package/dist/vendors/ads-and-pixels/x-pixel.cjs +9 -5
- package/dist/vendors/analytics/adobe-analytics.cjs +90 -0
- package/dist/vendors/analytics/adobe-analytics.js +49 -0
- package/dist/vendors/analytics/ahrefs-analytics.cjs +11 -7
- package/dist/vendors/analytics/amplitude.cjs +193 -0
- package/dist/vendors/analytics/amplitude.js +134 -0
- package/dist/vendors/analytics/clearbit.cjs +69 -0
- package/dist/vendors/analytics/clearbit.js +28 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +11 -7
- package/dist/vendors/analytics/databuddy.cjs +11 -7
- package/dist/vendors/analytics/fathom-analytics.cjs +11 -7
- package/dist/vendors/analytics/google-tag.cjs +11 -7
- package/dist/vendors/analytics/heap.cjs +181 -0
- package/dist/vendors/analytics/heap.js +134 -0
- package/dist/vendors/analytics/hightouch.cjs +153 -0
- package/dist/vendors/analytics/hightouch.js +109 -0
- package/dist/vendors/analytics/hotjar.cjs +11 -7
- package/dist/vendors/analytics/logrocket.cjs +99 -0
- package/dist/vendors/analytics/logrocket.js +58 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +9 -5
- package/dist/vendors/analytics/microsoft-clarity.cjs +75 -47
- package/dist/vendors/analytics/microsoft-clarity.js +64 -40
- package/dist/vendors/analytics/mixpanel-analytics.cjs +31 -16
- package/dist/vendors/analytics/mixpanel-analytics.js +22 -11
- package/dist/vendors/analytics/pirsch.cjs +108 -0
- package/dist/vendors/analytics/pirsch.js +67 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +9 -5
- package/dist/vendors/analytics/posthog.cjs +63 -27
- package/dist/vendors/analytics/posthog.js +52 -20
- package/dist/vendors/analytics/promptwatch.cjs +11 -7
- package/dist/vendors/analytics/rudderstack.cjs +227 -0
- package/dist/vendors/analytics/rudderstack.js +183 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +9 -5
- package/dist/vendors/analytics/segment.cjs +9 -5
- package/dist/vendors/analytics/umami-analytics.cjs +9 -5
- package/dist/vendors/analytics/vercel-analytics.cjs +11 -7
- package/dist/vendors/functional/crisp.cjs +9 -5
- package/dist/vendors/functional/intercom.cjs +11 -7
- package/dist/vendors/tag-managers/google-tag-manager.cjs +11 -7
- package/dist-types/registry.d.ts +313 -241
- package/dist-types/types.d.ts +46 -4
- package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +18 -18
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +21 -21
- package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +32 -32
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +19 -19
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +16 -16
- package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +28 -28
- package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +13 -13
- package/dist-types/vendors/analytics/adobe-analytics.d.ts +75 -0
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +7 -7
- package/dist-types/vendors/analytics/amplitude.d.ts +234 -0
- package/dist-types/vendors/analytics/clearbit.d.ts +60 -0
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +7 -7
- package/dist-types/vendors/analytics/databuddy.d.ts +25 -25
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +11 -11
- package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
- package/dist-types/vendors/analytics/heap.d.ts +316 -0
- package/dist-types/vendors/analytics/hightouch.d.ts +285 -0
- package/dist-types/vendors/analytics/hotjar.d.ts +14 -14
- package/dist-types/vendors/analytics/logrocket.d.ts +101 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +42 -30
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +40 -28
- package/dist-types/vendors/analytics/pirsch.d.ts +96 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
- package/dist-types/vendors/analytics/posthog.d.ts +63 -45
- package/dist-types/vendors/analytics/promptwatch.d.ts +7 -7
- package/dist-types/vendors/analytics/rudderstack.d.ts +330 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +18 -18
- package/dist-types/vendors/analytics/segment.d.ts +13 -13
- package/dist-types/vendors/analytics/umami-analytics.d.ts +12 -12
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +16 -16
- package/dist-types/vendors/functional/crisp.d.ts +11 -11
- package/dist-types/vendors/functional/intercom.d.ts +16 -16
- package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +18 -18
- package/docs/README.md +62 -0
- package/docs/frameworks/javascript/script-loader.md +356 -0
- package/docs/frameworks/next/script-loader.md +501 -0
- package/docs/frameworks/react/script-loader.md +555 -0
- package/docs/integrations/adobe-analytics.md +160 -0
- package/docs/integrations/ahrefs-analytics.md +157 -0
- package/docs/integrations/amplitude.md +230 -0
- package/docs/integrations/building-integrations.md +239 -0
- package/docs/integrations/clearbit.md +130 -0
- package/docs/integrations/cloudflare-web-analytics.md +126 -0
- package/docs/integrations/crisp.md +140 -0
- package/docs/integrations/databuddy.md +205 -0
- package/docs/integrations/fathom-analytics.md +150 -0
- package/docs/integrations/google-maps.md +263 -0
- package/docs/integrations/google-tag-manager.md +154 -0
- package/docs/integrations/google-tag.md +134 -0
- package/docs/integrations/heap.md +219 -0
- package/docs/integrations/hightouch.md +199 -0
- package/docs/integrations/hotjar.md +143 -0
- package/docs/integrations/intercom.md +144 -0
- package/docs/integrations/linkedin-insights.md +161 -0
- package/docs/integrations/logrocket.md +175 -0
- package/docs/integrations/matomo-analytics.md +171 -0
- package/docs/integrations/meta-pixel.md +412 -0
- package/docs/integrations/microsoft-clarity.md +173 -0
- package/docs/integrations/microsoft-uet.md +156 -0
- package/docs/integrations/mixpanel-analytics.md +130 -0
- package/docs/integrations/overview.md +149 -0
- package/docs/integrations/pirsch.md +142 -0
- package/docs/integrations/plausible-analytics.md +154 -0
- package/docs/integrations/posthog.md +258 -0
- package/docs/integrations/promptwatch.md +121 -0
- package/docs/integrations/reddit-pixel.md +241 -0
- package/docs/integrations/rudderstack.md +271 -0
- package/docs/integrations/rybbit-analytics.md +143 -0
- package/docs/integrations/segment.md +146 -0
- package/docs/integrations/snapchat-pixel.md +163 -0
- package/docs/integrations/tiktok-pixel.md +123 -0
- package/docs/integrations/umami-analytics.md +148 -0
- package/docs/integrations/vercel-analytics.md +141 -0
- package/docs/integrations/x-pixel.md +157 -0
- package/docs/integrations/youtube.md +193 -0
- package/docs/shared/react/guides/script-loader.md +311 -0
- package/package.json +61 -7
- package/readme.json +8 -4
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import type { Script } from 'c15t';
|
|
2
|
+
export declare const RUDDERSTACK_QUEUE_METHODS: readonly ['setDefaultInstanceKey', 'load', 'ready', 'page', 'track', 'identify', 'alias', 'group', 'reset', 'setAnonymousId', 'startSession', 'endSession', 'consent', 'addCustomIntegration'];
|
|
3
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
4
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
5
|
+
/**
|
|
6
|
+
* JSON-serializable object passed to RudderStack's `load()` API.
|
|
7
|
+
*/
|
|
8
|
+
export interface JsonObject {
|
|
9
|
+
[key: string]: JsonValue;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RudderStack JavaScript SDK `load()` options.
|
|
13
|
+
*
|
|
14
|
+
* The options are interpolated into a script manifest and passed as the third
|
|
15
|
+
* `rudderanalytics.load(writeKey, dataPlaneUrl, options)` argument. Keep values
|
|
16
|
+
* JSON-serializable: plain objects, arrays, strings, numbers, booleans, and
|
|
17
|
+
* `null`. Functions, class instances, Dates, Maps, Sets, and symbols are not
|
|
18
|
+
* supported.
|
|
19
|
+
*/
|
|
20
|
+
export type RudderStackLoadOptions = JsonObject;
|
|
21
|
+
/**
|
|
22
|
+
* Public RudderStack JavaScript SDK API exposed on `window.rudderanalytics`.
|
|
23
|
+
*
|
|
24
|
+
* The official v3 CDN snippet starts as an array-backed queue and the loaded
|
|
25
|
+
* SDK replaces it with an initialized runtime object. Use this interface for
|
|
26
|
+
* calls made after consent has allowed the SDK to load.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* window.rudderanalytics?.track('Signup Completed', { plan: 'pro' });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export interface RudderStackApi {
|
|
34
|
+
/**
|
|
35
|
+
* Sets the default instance key for multi-instance setups.
|
|
36
|
+
*
|
|
37
|
+
* @param key - Instance key to use for subsequent calls.
|
|
38
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
39
|
+
*/
|
|
40
|
+
setDefaultInstanceKey: (key: string) => unknown;
|
|
41
|
+
/**
|
|
42
|
+
* Loads and initializes the RudderStack JavaScript SDK.
|
|
43
|
+
*
|
|
44
|
+
* @param writeKey - Source write key from RudderStack.
|
|
45
|
+
* @param dataPlaneUrl - HTTPS data plane URL for the source.
|
|
46
|
+
* @param options - Optional JSON-serializable load options.
|
|
47
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
48
|
+
*/
|
|
49
|
+
load: (writeKey: string, dataPlaneUrl: string, options?: RudderStackLoadOptions) => unknown;
|
|
50
|
+
/**
|
|
51
|
+
* Registers a callback that fires when the SDK is ready.
|
|
52
|
+
*
|
|
53
|
+
* @param callback - Function to run once the SDK is ready.
|
|
54
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
55
|
+
*/
|
|
56
|
+
ready: (callback: () => void) => unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Tracks a page view with optional category, name, properties, and options.
|
|
59
|
+
*
|
|
60
|
+
* @param category - Optional page category.
|
|
61
|
+
* @param name - Optional page name.
|
|
62
|
+
* @param properties - Optional page metadata payload.
|
|
63
|
+
* @param options - Optional event context or integrations options.
|
|
64
|
+
* @param callback - Optional callback after processing.
|
|
65
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
66
|
+
*/
|
|
67
|
+
page: (category?: string, name?: string, properties?: Record<string, unknown>, options?: Record<string, unknown>, callback?: () => void) => unknown;
|
|
68
|
+
/**
|
|
69
|
+
* Tracks a named event.
|
|
70
|
+
*
|
|
71
|
+
* @param event - Event name to record.
|
|
72
|
+
* @param properties - Optional event properties payload.
|
|
73
|
+
* @param options - Optional event context or integrations options.
|
|
74
|
+
* @param callback - Optional callback after processing.
|
|
75
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
76
|
+
*/
|
|
77
|
+
track: (event: string, properties?: Record<string, unknown>, options?: Record<string, unknown>, callback?: () => void) => unknown;
|
|
78
|
+
/**
|
|
79
|
+
* Identifies a user and associates traits with that identity.
|
|
80
|
+
*
|
|
81
|
+
* @param userId - Stable user identifier.
|
|
82
|
+
* @param traits - Optional trait map associated with the user.
|
|
83
|
+
* @param options - Optional event context or integrations options.
|
|
84
|
+
* @param callback - Optional callback after processing.
|
|
85
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
86
|
+
*/
|
|
87
|
+
identify: (userId: string, traits?: Record<string, unknown>, options?: Record<string, unknown>, callback?: () => void) => unknown;
|
|
88
|
+
/**
|
|
89
|
+
* Aliases one user identifier to another.
|
|
90
|
+
*
|
|
91
|
+
* @param userId - New canonical user identifier.
|
|
92
|
+
* @param previousId - Optional previous identifier.
|
|
93
|
+
* @param options - Optional event context or integrations options.
|
|
94
|
+
* @param callback - Optional callback after processing.
|
|
95
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
96
|
+
*/
|
|
97
|
+
alias: (userId: string, previousId?: string, options?: Record<string, unknown>, callback?: () => void) => unknown;
|
|
98
|
+
/**
|
|
99
|
+
* Associates the current user with a group or account.
|
|
100
|
+
*
|
|
101
|
+
* @param groupId - Group or account identifier.
|
|
102
|
+
* @param traits - Optional group trait map.
|
|
103
|
+
* @param options - Optional event context or integrations options.
|
|
104
|
+
* @param callback - Optional callback after processing.
|
|
105
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
106
|
+
*/
|
|
107
|
+
group: (groupId: string, traits?: Record<string, unknown>, options?: Record<string, unknown>, callback?: () => void) => unknown;
|
|
108
|
+
/**
|
|
109
|
+
* Clears the current user identity state.
|
|
110
|
+
*
|
|
111
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
112
|
+
*/
|
|
113
|
+
reset: () => unknown;
|
|
114
|
+
/**
|
|
115
|
+
* Sets the anonymous ID used for subsequent events.
|
|
116
|
+
*
|
|
117
|
+
* @param anonymousId - Anonymous identifier to assign.
|
|
118
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
119
|
+
*/
|
|
120
|
+
setAnonymousId: (anonymousId: string) => unknown;
|
|
121
|
+
/**
|
|
122
|
+
* Starts a session with an optional session identifier.
|
|
123
|
+
*
|
|
124
|
+
* @param sessionId - Optional session identifier.
|
|
125
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
126
|
+
*/
|
|
127
|
+
startSession: (sessionId?: string) => unknown;
|
|
128
|
+
/**
|
|
129
|
+
* Ends the current session.
|
|
130
|
+
*
|
|
131
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
132
|
+
*/
|
|
133
|
+
endSession: () => unknown;
|
|
134
|
+
/**
|
|
135
|
+
* Transitions the SDK from pre-consent to post-consent behavior.
|
|
136
|
+
*
|
|
137
|
+
* @param consentOptions - Vendor-supported consent options.
|
|
138
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
139
|
+
*
|
|
140
|
+
* @remarks
|
|
141
|
+
* This API is for RudderStack's consent-management flow. In the default
|
|
142
|
+
* (blocked-load) mode it is not a c15t revocation hook; c15t unloads the
|
|
143
|
+
* SDK when measurement consent is revoked. In the opt-in pre-consent mode
|
|
144
|
+
* (`consentManagement` option) c15t calls it with the mapped consent IDs on
|
|
145
|
+
* every consent decision and change.
|
|
146
|
+
*/
|
|
147
|
+
consent: (consentOptions?: Record<string, unknown>) => unknown;
|
|
148
|
+
/**
|
|
149
|
+
* Registers a custom device-mode integration. RudderStack only accepts
|
|
150
|
+
* registrations made before `load()` completes, which is why this is part
|
|
151
|
+
* of the pre-load queue.
|
|
152
|
+
*
|
|
153
|
+
* @param name - Integration name.
|
|
154
|
+
* @param integration - Integration implementation object.
|
|
155
|
+
* @returns The RudderStack runtime or a promise-like value from the SDK.
|
|
156
|
+
*/
|
|
157
|
+
addCustomIntegration: (name: string, integration: unknown) => unknown;
|
|
158
|
+
}
|
|
159
|
+
declare global {
|
|
160
|
+
interface Window {
|
|
161
|
+
rudderanalytics?: RudderStackApi;
|
|
162
|
+
rudderAnalyticsBuildType?: string;
|
|
163
|
+
RudderSnippetVersion?: string;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* RudderStack vendor manifest.
|
|
168
|
+
*
|
|
169
|
+
* Creates RudderStack's v3 `window.rudderanalytics` queue, marks the snippet as
|
|
170
|
+
* seeded, queues the required `load()` call and optional `page()` call, then
|
|
171
|
+
* lets c15t own the script element.
|
|
172
|
+
*/
|
|
173
|
+
export declare const rudderstackManifest: {
|
|
174
|
+
readonly kind: "c15t.vendor-manifest";
|
|
175
|
+
readonly schemaVersion: 1;
|
|
176
|
+
readonly vendor: 'rudderstack';
|
|
177
|
+
readonly category: 'measurement';
|
|
178
|
+
readonly bootstrap: [{
|
|
179
|
+
readonly type: 'setGlobal';
|
|
180
|
+
readonly name: 'rudderanalytics';
|
|
181
|
+
readonly value: readonly [];
|
|
182
|
+
readonly ifUndefined: true;
|
|
183
|
+
}, {
|
|
184
|
+
readonly type: 'setGlobal';
|
|
185
|
+
readonly name: 'RudderSnippetVersion';
|
|
186
|
+
readonly value: '3.0.32';
|
|
187
|
+
}, {
|
|
188
|
+
readonly type: 'setGlobal';
|
|
189
|
+
readonly name: 'rudderAnalyticsBuildType';
|
|
190
|
+
readonly value: 'modern';
|
|
191
|
+
}, {
|
|
192
|
+
readonly type: 'setGlobalPath';
|
|
193
|
+
readonly path: ["rudderanalytics", "snippetExecuted"];
|
|
194
|
+
readonly value: true;
|
|
195
|
+
}, {
|
|
196
|
+
readonly type: 'defineQueueMethods';
|
|
197
|
+
readonly target: 'rudderanalytics';
|
|
198
|
+
readonly methods: ["setDefaultInstanceKey", "load", "ready", "page", "track", "identify", "alias", "group", "reset", "setAnonymousId", "startSession", "endSession", "consent", "addCustomIntegration"];
|
|
199
|
+
}];
|
|
200
|
+
readonly install: [{
|
|
201
|
+
readonly type: 'callGlobal';
|
|
202
|
+
readonly global: 'rudderanalytics';
|
|
203
|
+
readonly method: 'load';
|
|
204
|
+
readonly args: ["{{writeKey}}", "{{dataPlaneUrl}}", "{{loadOptions}}"];
|
|
205
|
+
}, {
|
|
206
|
+
readonly type: 'callGlobal';
|
|
207
|
+
readonly global: 'rudderanalytics';
|
|
208
|
+
readonly method: 'page';
|
|
209
|
+
}, {
|
|
210
|
+
readonly type: 'loadScript';
|
|
211
|
+
readonly src: '{{scriptUrl}}';
|
|
212
|
+
readonly async: true;
|
|
213
|
+
readonly attributes: {
|
|
214
|
+
readonly 'data-loader': 'RS_JS_SDK';
|
|
215
|
+
readonly 'data-rsa-write-key': '{{writeKey}}';
|
|
216
|
+
};
|
|
217
|
+
}];
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* c15t consent categories accepted by the RudderStack consent mapping.
|
|
221
|
+
*/
|
|
222
|
+
export type RudderStackConsentCategory = 'necessary' | 'functionality' | 'experience' | 'measurement' | 'marketing';
|
|
223
|
+
/**
|
|
224
|
+
* Opt-in pre-consent mode configuration.
|
|
225
|
+
*
|
|
226
|
+
* When provided, the SDK loads immediately for every visitor in RudderStack's
|
|
227
|
+
* pre-consent state (no persistent storage, events buffered in memory) and
|
|
228
|
+
* c15t signals consent decisions through `rudderanalytics.consent()` with the
|
|
229
|
+
* mapped consent IDs. This preserves pre-consent event attribution for users
|
|
230
|
+
* who go on to consent, at the cost of running vendor code before consent.
|
|
231
|
+
*
|
|
232
|
+
* Every destination in your RudderStack workspace must carry the consent IDs
|
|
233
|
+
* used here — c15t cannot verify that configuration from the browser, which is
|
|
234
|
+
* why this mode is opt-in and blocking the load stays the default.
|
|
235
|
+
*/
|
|
236
|
+
export interface RudderStackConsentManagementOptions {
|
|
237
|
+
/**
|
|
238
|
+
* c15t consent category → RudderStack consent IDs.
|
|
239
|
+
*
|
|
240
|
+
* IDs come from your RudderStack destination consent settings. Categories
|
|
241
|
+
* granted in c15t contribute their IDs to `allowedConsentIds`; everything
|
|
242
|
+
* else lands in `deniedConsentIds`.
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```ts
|
|
246
|
+
* {
|
|
247
|
+
* measurement: ['product-analytics'],
|
|
248
|
+
* marketing: ['ad-destinations'],
|
|
249
|
+
* }
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
mapping: Partial<Record<RudderStackConsentCategory, string[]>>;
|
|
253
|
+
}
|
|
254
|
+
export interface RudderStackOptions {
|
|
255
|
+
/**
|
|
256
|
+
* RudderStack source write key.
|
|
257
|
+
*/
|
|
258
|
+
writeKey: string;
|
|
259
|
+
/**
|
|
260
|
+
* RudderStack HTTPS data plane URL.
|
|
261
|
+
*/
|
|
262
|
+
dataPlaneUrl: string;
|
|
263
|
+
/**
|
|
264
|
+
* Opt into RudderStack's pre-consent mode with c15t as the consent
|
|
265
|
+
* provider instead of blocking the SDK load until consent.
|
|
266
|
+
*
|
|
267
|
+
* Defaults to `undefined`, which keeps the safe default: the SDK does not
|
|
268
|
+
* load until `measurement` consent is granted. See
|
|
269
|
+
* {@link RudderStackConsentManagementOptions} for the tradeoffs.
|
|
270
|
+
*/
|
|
271
|
+
consentManagement?: RudderStackConsentManagementOptions;
|
|
272
|
+
/**
|
|
273
|
+
* Optional JSON-serializable RudderStack `load()` options.
|
|
274
|
+
*
|
|
275
|
+
* Values must be JSON-serializable because c15t resolves the manifest into
|
|
276
|
+
* script lifecycle callbacks. Do not pass functions, Dates, Maps, Sets,
|
|
277
|
+
* class instances, symbols, or other non-JSON values.
|
|
278
|
+
*/
|
|
279
|
+
loadOptions?: RudderStackLoadOptions;
|
|
280
|
+
/**
|
|
281
|
+
* Queue the initial `rudderanalytics.page()` call during setup.
|
|
282
|
+
*
|
|
283
|
+
* @default true
|
|
284
|
+
*/
|
|
285
|
+
trackPageView?: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Optional full loader URL override.
|
|
288
|
+
*
|
|
289
|
+
* @default 'https://cdn.rudderlabs.com/v3/modern/rsa.min.js'
|
|
290
|
+
*/
|
|
291
|
+
scriptUrl?: string;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Creates a RudderStack JavaScript SDK script.
|
|
295
|
+
*
|
|
296
|
+
* @see https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/quickstart/
|
|
297
|
+
*
|
|
298
|
+
* @param options - The options for the RudderStack script.
|
|
299
|
+
* @returns The RudderStack script configuration.
|
|
300
|
+
* @throws {Error} When `writeKey` is missing or only whitespace.
|
|
301
|
+
* @throws {Error} When `dataPlaneUrl` is missing, invalid, or not HTTPS.
|
|
302
|
+
*
|
|
303
|
+
* @remarks
|
|
304
|
+
* RudderStack collects customer behavior and sends it to destinations through
|
|
305
|
+
* your configured data plane. By default c15t gates the browser SDK on
|
|
306
|
+
* `measurement` consent and unloads it when that consent is revoked.
|
|
307
|
+
* `loadOptions` is passed directly as the third `load()` argument and must be
|
|
308
|
+
* JSON-serializable.
|
|
309
|
+
*
|
|
310
|
+
* Pass `consentManagement` to opt into RudderStack's pre-consent mode instead:
|
|
311
|
+
* the SDK loads immediately with no persistent storage and buffered events,
|
|
312
|
+
* and c15t signals every consent decision through `rudderanalytics.consent()`
|
|
313
|
+
* with your mapped consent IDs — preserving pre-consent event attribution for
|
|
314
|
+
* users who consent. Requires consent IDs on every RudderStack destination.
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* ```ts
|
|
318
|
+
* import { rudderstack } from '@c15t/scripts/rudderstack';
|
|
319
|
+
*
|
|
320
|
+
* rudderstack({
|
|
321
|
+
* writeKey: 'WRITE_KEY',
|
|
322
|
+
* dataPlaneUrl: 'https://example.dataplane.rudderstack.com',
|
|
323
|
+
* loadOptions: {
|
|
324
|
+
* useBeacon: true,
|
|
325
|
+
* },
|
|
326
|
+
* });
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
329
|
+
export declare function rudderstack({ writeKey, dataPlaneUrl, consentManagement, loadOptions, trackPageView, scriptUrl, }: RudderStackOptions): Script;
|
|
330
|
+
export {};
|
|
@@ -16,29 +16,29 @@ declare global {
|
|
|
16
16
|
* Rybbit reads its configuration from script data attributes at load time.
|
|
17
17
|
*/
|
|
18
18
|
export declare const rybbitAnalyticsManifest: {
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
19
|
+
readonly kind: "c15t.vendor-manifest";
|
|
20
|
+
readonly schemaVersion: 1;
|
|
21
|
+
readonly vendor: 'rybbit-analytics';
|
|
22
|
+
readonly category: 'measurement';
|
|
21
23
|
readonly install: [{
|
|
22
|
-
readonly type:
|
|
23
|
-
readonly src:
|
|
24
|
+
readonly type: 'loadScript';
|
|
25
|
+
readonly src: '{{scriptUrl}}';
|
|
24
26
|
readonly defer: true;
|
|
25
27
|
readonly attributes: {
|
|
26
|
-
readonly 'data-site-id':
|
|
27
|
-
readonly 'data-auto-track-pageview':
|
|
28
|
-
readonly 'data-track-spa':
|
|
29
|
-
readonly 'data-track-query':
|
|
30
|
-
readonly 'data-track-outbound':
|
|
31
|
-
readonly 'data-track-errors':
|
|
32
|
-
readonly 'data-session-replay':
|
|
33
|
-
readonly 'data-web-vitals':
|
|
34
|
-
readonly 'data-skip-patterns':
|
|
35
|
-
readonly 'data-mask-patterns':
|
|
36
|
-
readonly 'data-debounce':
|
|
37
|
-
readonly 'data-api-key':
|
|
28
|
+
readonly 'data-site-id': '{{siteId}}';
|
|
29
|
+
readonly 'data-auto-track-pageview': '{{autoTrackPageview}}';
|
|
30
|
+
readonly 'data-track-spa': '{{trackSpa}}';
|
|
31
|
+
readonly 'data-track-query': '{{trackQuery}}';
|
|
32
|
+
readonly 'data-track-outbound': '{{trackOutbound}}';
|
|
33
|
+
readonly 'data-track-errors': '{{trackErrors}}';
|
|
34
|
+
readonly 'data-session-replay': '{{sessionReplay}}';
|
|
35
|
+
readonly 'data-web-vitals': '{{webVitals}}';
|
|
36
|
+
readonly 'data-skip-patterns': '{{skipPatterns}}';
|
|
37
|
+
readonly 'data-mask-patterns': '{{maskPatterns}}';
|
|
38
|
+
readonly 'data-debounce': '{{debounce}}';
|
|
39
|
+
readonly 'data-api-key': '{{apiKey}}';
|
|
38
40
|
};
|
|
39
41
|
}];
|
|
40
|
-
readonly kind: "c15t.vendor-manifest";
|
|
41
|
-
readonly schemaVersion: 1;
|
|
42
42
|
};
|
|
43
43
|
export interface RybbitAnalyticsOptions {
|
|
44
44
|
/** Your Rybbit site ID. */
|
|
@@ -117,29 +117,29 @@ declare global {
|
|
|
117
117
|
* the initial `page()` call before the bundle loads.
|
|
118
118
|
*/
|
|
119
119
|
export declare const segmentManifest: {
|
|
120
|
-
readonly
|
|
121
|
-
readonly
|
|
120
|
+
readonly kind: "c15t.vendor-manifest";
|
|
121
|
+
readonly schemaVersion: 1;
|
|
122
|
+
readonly vendor: 'segment';
|
|
123
|
+
readonly category: 'measurement';
|
|
122
124
|
readonly bootstrap: [{
|
|
123
|
-
readonly type:
|
|
124
|
-
readonly name:
|
|
125
|
+
readonly type: 'setGlobal';
|
|
126
|
+
readonly name: 'analytics';
|
|
125
127
|
readonly value: readonly [];
|
|
126
128
|
readonly ifUndefined: true;
|
|
127
129
|
}, {
|
|
128
|
-
readonly type:
|
|
129
|
-
readonly target:
|
|
130
|
+
readonly type: 'defineQueueMethods';
|
|
131
|
+
readonly target: 'analytics';
|
|
130
132
|
readonly methods: ["track", "page", "identify", "group", "alias", "reset"];
|
|
131
133
|
}];
|
|
132
134
|
readonly install: [{
|
|
133
|
-
readonly type:
|
|
134
|
-
readonly global:
|
|
135
|
-
readonly method:
|
|
135
|
+
readonly type: 'callGlobal';
|
|
136
|
+
readonly global: 'analytics';
|
|
137
|
+
readonly method: 'page';
|
|
136
138
|
}, {
|
|
137
|
-
readonly type:
|
|
138
|
-
readonly src:
|
|
139
|
+
readonly type: 'loadScript';
|
|
140
|
+
readonly src: '{{scriptUrl}}';
|
|
139
141
|
readonly async: true;
|
|
140
142
|
}];
|
|
141
|
-
readonly kind: "c15t.vendor-manifest";
|
|
142
|
-
readonly schemaVersion: 1;
|
|
143
143
|
};
|
|
144
144
|
export interface SegmentOptions {
|
|
145
145
|
/** Your Segment write key. */
|
|
@@ -18,23 +18,23 @@ declare global {
|
|
|
18
18
|
* `measurement` and unloaded when consent is revoked.
|
|
19
19
|
*/
|
|
20
20
|
export declare const umamiAnalyticsManifest: {
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
21
|
+
readonly kind: "c15t.vendor-manifest";
|
|
22
|
+
readonly schemaVersion: 1;
|
|
23
|
+
readonly vendor: 'umami-analytics';
|
|
24
|
+
readonly category: 'measurement';
|
|
23
25
|
readonly install: [{
|
|
24
|
-
readonly type:
|
|
25
|
-
readonly src:
|
|
26
|
+
readonly type: 'loadScript';
|
|
27
|
+
readonly src: '{{scriptUrl}}';
|
|
26
28
|
readonly defer: true;
|
|
27
29
|
readonly attributes: {
|
|
28
|
-
readonly 'data-website-id':
|
|
29
|
-
readonly 'data-host-url':
|
|
30
|
-
readonly 'data-auto-track':
|
|
31
|
-
readonly 'data-domains':
|
|
32
|
-
readonly 'data-tag':
|
|
33
|
-
readonly 'data-before-send':
|
|
30
|
+
readonly 'data-website-id': '{{websiteId}}';
|
|
31
|
+
readonly 'data-host-url': '{{hostUrl}}';
|
|
32
|
+
readonly 'data-auto-track': '{{autoTrackAttribute}}';
|
|
33
|
+
readonly 'data-domains': '{{domains}}';
|
|
34
|
+
readonly 'data-tag': '{{tag}}';
|
|
35
|
+
readonly 'data-before-send': '{{beforeSend}}';
|
|
34
36
|
};
|
|
35
37
|
}];
|
|
36
|
-
readonly kind: "c15t.vendor-manifest";
|
|
37
|
-
readonly schemaVersion: 1;
|
|
38
38
|
};
|
|
39
39
|
export interface UmamiAnalyticsOptions {
|
|
40
40
|
/**
|
|
@@ -13,35 +13,35 @@ declare global {
|
|
|
13
13
|
* Seeds Vercel's event queue before loading the tracker bundle.
|
|
14
14
|
*/
|
|
15
15
|
export declare const vercelAnalyticsManifest: {
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
16
|
+
readonly kind: "c15t.vendor-manifest";
|
|
17
|
+
readonly schemaVersion: 1;
|
|
18
|
+
readonly vendor: 'vercel-analytics';
|
|
19
|
+
readonly category: 'measurement';
|
|
18
20
|
readonly bootstrap: [{
|
|
19
|
-
readonly type:
|
|
20
|
-
readonly name:
|
|
21
|
+
readonly type: 'setGlobal';
|
|
22
|
+
readonly name: 'vaq';
|
|
21
23
|
readonly value: readonly [];
|
|
22
24
|
readonly ifUndefined: true;
|
|
23
25
|
}, {
|
|
24
|
-
readonly type:
|
|
25
|
-
readonly name:
|
|
26
|
+
readonly type: 'defineStubFunction';
|
|
27
|
+
readonly name: 'va';
|
|
26
28
|
readonly queue: {
|
|
27
|
-
readonly global:
|
|
29
|
+
readonly global: 'vaq';
|
|
28
30
|
};
|
|
29
|
-
readonly queueFormat:
|
|
31
|
+
readonly queueFormat: 'array';
|
|
30
32
|
readonly ifUndefined: true;
|
|
31
33
|
}];
|
|
32
34
|
readonly install: [{
|
|
33
|
-
readonly type:
|
|
34
|
-
readonly src:
|
|
35
|
+
readonly type: 'loadScript';
|
|
36
|
+
readonly src: '{{scriptUrl}}';
|
|
35
37
|
readonly defer: true;
|
|
36
38
|
readonly attributes: {
|
|
37
|
-
readonly 'data-sdkn':
|
|
38
|
-
readonly 'data-dsn':
|
|
39
|
-
readonly 'data-disable-auto-track':
|
|
40
|
-
readonly 'data-endpoint':
|
|
39
|
+
readonly 'data-sdkn': 'c15t';
|
|
40
|
+
readonly 'data-dsn': '{{dsn}}';
|
|
41
|
+
readonly 'data-disable-auto-track': '{{disableAutoTrackAttribute}}';
|
|
42
|
+
readonly 'data-endpoint': '{{endpoint}}';
|
|
41
43
|
};
|
|
42
44
|
}];
|
|
43
|
-
readonly kind: "c15t.vendor-manifest";
|
|
44
|
-
readonly schemaVersion: 1;
|
|
45
45
|
};
|
|
46
46
|
export interface VercelAnalyticsOptions {
|
|
47
47
|
/** Project DSN for self-hosted or non-Vercel deployments. */
|
|
@@ -19,25 +19,25 @@ declare global {
|
|
|
19
19
|
* Optional runtime globals are added when provided by the helper options.
|
|
20
20
|
*/
|
|
21
21
|
export declare const crispManifest: {
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
22
|
+
readonly kind: "c15t.vendor-manifest";
|
|
23
|
+
readonly schemaVersion: 1;
|
|
24
|
+
readonly vendor: 'crisp';
|
|
25
|
+
readonly category: 'functionality';
|
|
24
26
|
readonly install: [{
|
|
25
|
-
readonly type:
|
|
26
|
-
readonly name:
|
|
27
|
+
readonly type: 'setGlobal';
|
|
28
|
+
readonly name: '$crisp';
|
|
27
29
|
readonly value: readonly [];
|
|
28
30
|
readonly ifUndefined: false;
|
|
29
31
|
}, {
|
|
30
|
-
readonly type:
|
|
31
|
-
readonly name:
|
|
32
|
-
readonly value:
|
|
32
|
+
readonly type: 'setGlobal';
|
|
33
|
+
readonly name: 'CRISP_WEBSITE_ID';
|
|
34
|
+
readonly value: '{{websiteId}}';
|
|
33
35
|
readonly ifUndefined: false;
|
|
34
36
|
}, {
|
|
35
|
-
readonly type:
|
|
36
|
-
readonly src:
|
|
37
|
+
readonly type: 'loadScript';
|
|
38
|
+
readonly src: '{{scriptSrc}}';
|
|
37
39
|
readonly async: true;
|
|
38
40
|
}];
|
|
39
|
-
readonly kind: "c15t.vendor-manifest";
|
|
40
|
-
readonly schemaVersion: 1;
|
|
41
41
|
};
|
|
42
42
|
export interface CrispOptions {
|
|
43
43
|
/** Your Crisp website ID. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Script } from 'c15t';
|
|
2
2
|
export declare const INTERCOM_API_BASES: {
|
|
3
|
-
readonly us:
|
|
4
|
-
readonly eu:
|
|
5
|
-
readonly au:
|
|
3
|
+
readonly us: 'https://api-iam.intercom.io';
|
|
4
|
+
readonly eu: 'https://api-iam.eu.intercom.io';
|
|
5
|
+
readonly au: 'https://api-iam.au.intercom.io';
|
|
6
6
|
};
|
|
7
7
|
export type IntercomApiBase = (typeof INTERCOM_API_BASES)[keyof typeof INTERCOM_API_BASES] | (string & {});
|
|
8
8
|
export type IntercomThemeMode = 'light' | 'dark' | 'system';
|
|
@@ -72,28 +72,28 @@ declare global {
|
|
|
72
72
|
* the messenger widget bundle.
|
|
73
73
|
*/
|
|
74
74
|
export declare const intercomManifest: {
|
|
75
|
-
readonly
|
|
76
|
-
readonly
|
|
75
|
+
readonly kind: "c15t.vendor-manifest";
|
|
76
|
+
readonly schemaVersion: 1;
|
|
77
|
+
readonly vendor: 'intercom';
|
|
78
|
+
readonly category: 'functionality';
|
|
77
79
|
readonly install: [{
|
|
78
|
-
readonly type:
|
|
79
|
-
readonly name:
|
|
80
|
+
readonly type: 'defineStubFunction';
|
|
81
|
+
readonly name: 'Intercom';
|
|
80
82
|
readonly queue: {
|
|
81
|
-
readonly property:
|
|
83
|
+
readonly property: 'q';
|
|
82
84
|
};
|
|
83
|
-
readonly queueFormat:
|
|
85
|
+
readonly queueFormat: 'array';
|
|
84
86
|
readonly ifUndefined: true;
|
|
85
87
|
}, {
|
|
86
|
-
readonly type:
|
|
87
|
-
readonly name:
|
|
88
|
-
readonly value:
|
|
88
|
+
readonly type: 'setGlobal';
|
|
89
|
+
readonly name: 'intercomSettings';
|
|
90
|
+
readonly value: '{{settings}}';
|
|
89
91
|
readonly ifUndefined: false;
|
|
90
92
|
}, {
|
|
91
|
-
readonly type:
|
|
92
|
-
readonly src:
|
|
93
|
+
readonly type: 'loadScript';
|
|
94
|
+
readonly src: '{{scriptSrc}}';
|
|
93
95
|
readonly async: true;
|
|
94
96
|
}];
|
|
95
|
-
readonly kind: "c15t.vendor-manifest";
|
|
96
|
-
readonly schemaVersion: 1;
|
|
97
97
|
};
|
|
98
98
|
export interface IntercomOptions {
|
|
99
99
|
/**
|