@c15t/scripts 3.0.0-alpha.1 → 3.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/AGENTS.md +129 -59
  2. package/README.md +8 -29
  3. package/SKILL.md +33 -0
  4. package/dist/adobe-analytics.js +2 -0
  5. package/dist/ahrefs-analytics.js +2 -0
  6. package/dist/amplitude.js +2 -0
  7. package/dist/clearbit.js +2 -0
  8. package/dist/cloudflare-web-analytics.js +2 -0
  9. package/dist/cloudflare-zaraz.js +2 -0
  10. package/dist/crisp.js +2 -0
  11. package/dist/databuddy.js +2 -0
  12. package/dist/e2e-test-utils.js +2 -137
  13. package/dist/engine/compile.js +2 -89
  14. package/dist/engine/runtime.js +2 -448
  15. package/dist/events.js +2 -0
  16. package/dist/fathom-analytics.js +2 -0
  17. package/dist/front-chat.js +2 -0
  18. package/dist/google-tag-manager.js +2 -0
  19. package/dist/google-tag.js +2 -0
  20. package/dist/heap.js +2 -0
  21. package/dist/hightouch.js +2 -0
  22. package/dist/hotjar.js +2 -0
  23. package/dist/intercom.js +2 -0
  24. package/dist/klaviyo.js +2 -0
  25. package/dist/linkedin-insights.js +2 -0
  26. package/dist/logrocket.js +2 -0
  27. package/dist/matomo-analytics.js +2 -0
  28. package/dist/meta-pixel.js +2 -0
  29. package/dist/microsoft-clarity.js +2 -0
  30. package/dist/microsoft-uet.js +2 -0
  31. package/dist/mixpanel-analytics.js +2 -0
  32. package/dist/one-dollar-stats.js +2 -0
  33. package/dist/openai-pixel.js +2 -0
  34. package/dist/pinterest-tag.js +2 -0
  35. package/dist/pirsch.js +2 -0
  36. package/dist/plausible-analytics.js +2 -0
  37. package/dist/posthog.js +2 -0
  38. package/dist/promptwatch.js +2 -0
  39. package/dist/reddit-pixel.js +2 -0
  40. package/dist/registry.js +2 -392
  41. package/dist/resolve.js +2 -33
  42. package/dist/rudderstack.js +2 -0
  43. package/dist/rybbit-analytics.js +2 -0
  44. package/dist/segment.js +2 -0
  45. package/dist/snapchat-pixel.js +2 -0
  46. package/dist/tiktok-pixel.js +2 -0
  47. package/dist/types.js +2 -16
  48. package/dist/umami-analytics.js +2 -0
  49. package/dist/vendors/_shared/attributes.js +2 -14
  50. package/dist/vendors/_shared/google-consent.js +2 -27
  51. package/dist/vendors/_shared/install-builders.js +2 -21
  52. package/dist/vendors/_shared/required-id.js +2 -0
  53. package/dist/vendors/_shared/script-url.js +2 -28
  54. package/dist/vendors/ads-and-pixels/linkedin-insights.js +2 -48
  55. package/dist/vendors/ads-and-pixels/meta-pixel.js +2 -153
  56. package/dist/vendors/ads-and-pixels/microsoft-uet.js +2 -110
  57. package/dist/vendors/ads-and-pixels/openai-pixel.js +2 -88
  58. package/dist/vendors/ads-and-pixels/pinterest-tag.js +2 -0
  59. package/dist/vendors/ads-and-pixels/reddit-pixel.js +2 -107
  60. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +2 -87
  61. package/dist/vendors/ads-and-pixels/tiktok-pixel.js +2 -89
  62. package/dist/vendors/ads-and-pixels/x-pixel.js +2 -48
  63. package/dist/vendors/analytics/adobe-analytics.js +2 -49
  64. package/dist/vendors/analytics/ahrefs-analytics.js +2 -27
  65. package/dist/vendors/analytics/amplitude.js +2 -134
  66. package/dist/vendors/analytics/clearbit.js +2 -28
  67. package/dist/vendors/analytics/cloudflare-web-analytics.js +2 -32
  68. package/dist/vendors/analytics/databuddy.js +2 -103
  69. package/dist/vendors/analytics/fathom-analytics.js +2 -35
  70. package/dist/vendors/analytics/google-tag.js +2 -66
  71. package/dist/vendors/analytics/heap.js +2 -134
  72. package/dist/vendors/analytics/hightouch.js +2 -109
  73. package/dist/vendors/analytics/hotjar.js +2 -44
  74. package/dist/vendors/analytics/logrocket.js +2 -58
  75. package/dist/vendors/analytics/matomo-analytics.js +2 -191
  76. package/dist/vendors/analytics/microsoft-clarity.js +2 -100
  77. package/dist/vendors/analytics/mixpanel-analytics.js +2 -93
  78. package/dist/vendors/analytics/one-dollar-stats.js +2 -0
  79. package/dist/vendors/analytics/pirsch.js +2 -67
  80. package/dist/vendors/analytics/plausible-analytics.js +2 -81
  81. package/dist/vendors/analytics/posthog.js +2 -200
  82. package/dist/vendors/analytics/promptwatch.js +2 -29
  83. package/dist/vendors/analytics/rudderstack.js +2 -183
  84. package/dist/vendors/analytics/rybbit-analytics.js +2 -63
  85. package/dist/vendors/analytics/segment.js +2 -56
  86. package/dist/vendors/analytics/umami-analytics.js +2 -39
  87. package/dist/vendors/analytics/vercel-analytics.js +2 -53
  88. package/dist/vendors/email-and-sms/klaviyo.js +2 -0
  89. package/dist/vendors/functional/crisp.js +2 -100
  90. package/dist/vendors/functional/front-chat.js +2 -0
  91. package/dist/vendors/functional/intercom.js +2 -45
  92. package/dist/vendors/tag-managers/cloudflare-zaraz.js +2 -98
  93. package/dist/vendors/tag-managers/google-tag-manager.js +2 -59
  94. package/dist/vercel-analytics.js +2 -0
  95. package/dist/x-pixel.js +2 -0
  96. package/dist-types/adobe-analytics.d.ts +2 -0
  97. package/dist-types/ahrefs-analytics.d.ts +2 -0
  98. package/dist-types/amplitude.d.ts +2 -0
  99. package/dist-types/clearbit.d.ts +2 -0
  100. package/dist-types/cloudflare-web-analytics.d.ts +2 -0
  101. package/dist-types/cloudflare-zaraz.d.ts +2 -0
  102. package/dist-types/crisp.d.ts +2 -0
  103. package/dist-types/databuddy.d.ts +2 -0
  104. package/dist-types/e2e-test-utils.d.ts +2 -0
  105. package/dist-types/engine/compile.d.ts +2 -3
  106. package/dist-types/engine/runtime.d.ts +2 -3
  107. package/dist-types/events.d.ts +2 -0
  108. package/dist-types/fathom-analytics.d.ts +2 -0
  109. package/dist-types/front-chat.d.ts +2 -0
  110. package/dist-types/google-tag-manager.d.ts +2 -0
  111. package/dist-types/google-tag.d.ts +2 -0
  112. package/dist-types/heap.d.ts +2 -0
  113. package/dist-types/hightouch.d.ts +2 -0
  114. package/dist-types/hotjar.d.ts +2 -0
  115. package/dist-types/intercom.d.ts +2 -0
  116. package/dist-types/klaviyo.d.ts +2 -0
  117. package/dist-types/linkedin-insights.d.ts +2 -0
  118. package/dist-types/logrocket.d.ts +2 -0
  119. package/dist-types/matomo-analytics.d.ts +2 -0
  120. package/dist-types/meta-pixel.d.ts +2 -0
  121. package/dist-types/microsoft-clarity.d.ts +2 -0
  122. package/dist-types/microsoft-uet.d.ts +2 -0
  123. package/dist-types/mixpanel-analytics.d.ts +2 -0
  124. package/dist-types/one-dollar-stats.d.ts +2 -0
  125. package/dist-types/openai-pixel.d.ts +2 -0
  126. package/dist-types/pinterest-tag.d.ts +2 -0
  127. package/dist-types/pirsch.d.ts +2 -0
  128. package/dist-types/plausible-analytics.d.ts +2 -0
  129. package/dist-types/posthog.d.ts +2 -0
  130. package/dist-types/promptwatch.d.ts +2 -0
  131. package/dist-types/reddit-pixel.d.ts +2 -0
  132. package/dist-types/registry.d.ts +2 -458
  133. package/dist-types/resolve.d.ts +2 -9
  134. package/dist-types/rudderstack.d.ts +2 -0
  135. package/dist-types/rybbit-analytics.d.ts +2 -0
  136. package/dist-types/segment.d.ts +2 -0
  137. package/dist-types/snapchat-pixel.d.ts +2 -0
  138. package/dist-types/tiktok-pixel.d.ts +2 -0
  139. package/dist-types/types.d.ts +2 -314
  140. package/dist-types/umami-analytics.d.ts +2 -0
  141. package/dist-types/vendors/_shared/attributes.d.ts +2 -35
  142. package/dist-types/vendors/_shared/google-consent.d.ts +2 -47
  143. package/dist-types/vendors/_shared/install-builders.d.ts +2 -30
  144. package/dist-types/vendors/_shared/required-id.d.ts +2 -0
  145. package/dist-types/vendors/_shared/script-url.d.ts +2 -75
  146. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +2 -92
  147. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +2 -289
  148. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +2 -105
  149. package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +2 -211
  150. package/dist-types/vendors/ads-and-pixels/pinterest-tag.d.ts +2 -0
  151. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +2 -210
  152. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +2 -171
  153. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +2 -106
  154. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +2 -183
  155. package/dist-types/vendors/analytics/adobe-analytics.d.ts +2 -75
  156. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +2 -62
  157. package/dist-types/vendors/analytics/amplitude.d.ts +2 -234
  158. package/dist-types/vendors/analytics/clearbit.d.ts +2 -60
  159. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +2 -67
  160. package/dist-types/vendors/analytics/databuddy.d.ts +2 -147
  161. package/dist-types/vendors/analytics/fathom-analytics.d.ts +2 -90
  162. package/dist-types/vendors/analytics/google-tag.d.ts +2 -93
  163. package/dist-types/vendors/analytics/heap.d.ts +2 -316
  164. package/dist-types/vendors/analytics/hightouch.d.ts +2 -285
  165. package/dist-types/vendors/analytics/hotjar.d.ts +2 -73
  166. package/dist-types/vendors/analytics/logrocket.d.ts +2 -101
  167. package/dist-types/vendors/analytics/matomo-analytics.d.ts +2 -41
  168. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +2 -97
  169. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +2 -113
  170. package/dist-types/vendors/analytics/one-dollar-stats.d.ts +2 -0
  171. package/dist-types/vendors/analytics/pirsch.d.ts +2 -96
  172. package/dist-types/vendors/analytics/plausible-analytics.d.ts +2 -122
  173. package/dist-types/vendors/analytics/posthog.d.ts +2 -175
  174. package/dist-types/vendors/analytics/promptwatch.d.ts +2 -36
  175. package/dist-types/vendors/analytics/rudderstack.d.ts +2 -330
  176. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +2 -82
  177. package/dist-types/vendors/analytics/segment.d.ts +2 -158
  178. package/dist-types/vendors/analytics/umami-analytics.d.ts +2 -93
  179. package/dist-types/vendors/analytics/vercel-analytics.d.ts +2 -66
  180. package/dist-types/vendors/email-and-sms/klaviyo.d.ts +2 -0
  181. package/dist-types/vendors/functional/crisp.d.ts +2 -78
  182. package/dist-types/vendors/functional/front-chat.d.ts +2 -0
  183. package/dist-types/vendors/functional/intercom.d.ts +2 -135
  184. package/dist-types/vendors/tag-managers/cloudflare-zaraz.d.ts +2 -39
  185. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +2 -94
  186. package/dist-types/vercel-analytics.d.ts +2 -0
  187. package/dist-types/x-pixel.d.ts +2 -0
  188. package/docs/README.md +129 -59
  189. package/docs/assets/v3/bottom-bar.png +0 -0
  190. package/docs/assets/v3/brand-card.png +0 -0
  191. package/docs/assets/v3/brand-preferences.png +0 -0
  192. package/docs/assets/v3/choice-wall.png +0 -0
  193. package/docs/assets/v3/headless-bar-html.png +0 -0
  194. package/docs/assets/v3/headless-bar-mobile.png +0 -0
  195. package/docs/assets/v3/headless-bar.png +0 -0
  196. package/docs/assets/v3/slim-bar.png +0 -0
  197. package/docs/concepts/choose-your-setup.md +87 -0
  198. package/docs/concepts/consent-categories.md +84 -0
  199. package/docs/concepts/consent-state.md +357 -0
  200. package/docs/{guides → concepts}/data-fetching.md +31 -27
  201. package/docs/concepts/how-consent-works.md +123 -0
  202. package/docs/concepts/policies.md +71 -0
  203. package/docs/customization/class-names.md +202 -0
  204. package/docs/customization/dark-mode.md +157 -0
  205. package/docs/customization/motion.md +119 -0
  206. package/docs/customization/overview.md +67 -33
  207. package/docs/customization/recipes.md +839 -47
  208. package/docs/customization/slots.md +216 -35
  209. package/docs/customization/stylesheets.md +147 -0
  210. package/docs/customization/tailwind.md +842 -0
  211. package/docs/customization/tokens.md +166 -36
  212. package/docs/customization/translations.md +61 -3
  213. package/docs/frameworks/astro/embeds.md +160 -0
  214. package/docs/frameworks/astro/network-blocker.md +86 -0
  215. package/docs/frameworks/astro/scripts.md +146 -0
  216. package/docs/frameworks/html/embeds.md +142 -0
  217. package/docs/frameworks/html/network-blocker.md +105 -0
  218. package/docs/frameworks/html/scripts.md +164 -0
  219. package/docs/frameworks/javascript/scripts.md +119 -0
  220. package/docs/frameworks/next/embeds.md +90 -0
  221. package/docs/frameworks/next/network-blocker.md +153 -0
  222. package/docs/frameworks/next/scripts.md +196 -0
  223. package/docs/frameworks/nuxt/embeds.md +81 -0
  224. package/docs/frameworks/nuxt/network-blocker.md +97 -0
  225. package/docs/frameworks/nuxt/scripts.md +89 -0
  226. package/docs/frameworks/react/embeds.md +89 -0
  227. package/docs/frameworks/react/network-blocker.md +140 -0
  228. package/docs/frameworks/react/scripts.md +115 -0
  229. package/docs/frameworks/svelte/embeds.md +96 -0
  230. package/docs/frameworks/svelte/network-blocker.md +141 -0
  231. package/docs/frameworks/svelte/scripts.md +137 -0
  232. package/docs/frameworks/sveltekit/embeds.md +103 -0
  233. package/docs/frameworks/sveltekit/network-blocker.md +149 -0
  234. package/docs/frameworks/sveltekit/scripts.md +141 -0
  235. package/docs/frameworks/tanstack-start/embeds.md +96 -0
  236. package/docs/frameworks/tanstack-start/network-blocker.md +145 -0
  237. package/docs/frameworks/tanstack-start/scripts.md +103 -0
  238. package/docs/frameworks/vue/embeds.md +84 -0
  239. package/docs/frameworks/vue/network-blocker.md +99 -0
  240. package/docs/frameworks/vue/scripts.md +93 -0
  241. package/docs/guides/banner-experiments.md +654 -0
  242. package/docs/guides/troubleshooting.md +120 -47
  243. package/docs/guides/verify-consent.md +81 -49
  244. package/docs/integrations/adobe-analytics.md +168 -160
  245. package/docs/integrations/ahrefs-analytics.md +153 -155
  246. package/docs/integrations/amplitude.md +163 -157
  247. package/docs/integrations/building-integrations.md +136 -37
  248. package/docs/integrations/clearbit.md +155 -155
  249. package/docs/integrations/cloudflare-web-analytics.md +157 -157
  250. package/docs/integrations/cloudflare-zaraz.md +210 -262
  251. package/docs/integrations/crisp.md +165 -159
  252. package/docs/integrations/databuddy.md +158 -174
  253. package/docs/integrations/fathom-analytics.md +159 -157
  254. package/docs/integrations/front-chat.md +322 -0
  255. package/docs/integrations/google-maps.md +119 -84
  256. package/docs/integrations/google-tag-manager.md +179 -164
  257. package/docs/integrations/google-tag.md +164 -161
  258. package/docs/integrations/heap.md +164 -156
  259. package/docs/integrations/hightouch.md +162 -158
  260. package/docs/integrations/hotjar.md +160 -156
  261. package/docs/integrations/intercom.md +184 -154
  262. package/docs/integrations/klaviyo.md +486 -0
  263. package/docs/integrations/linkedin-insights.md +175 -151
  264. package/docs/integrations/logrocket.md +161 -157
  265. package/docs/integrations/matomo-analytics.md +189 -179
  266. package/docs/integrations/meta-pixel.md +189 -151
  267. package/docs/integrations/microsoft-clarity.md +164 -156
  268. package/docs/integrations/microsoft-uet.md +149 -155
  269. package/docs/integrations/mixpanel-analytics.md +156 -161
  270. package/docs/integrations/one-dollar-stats.md +306 -0
  271. package/docs/integrations/openai-pixel.md +205 -302
  272. package/docs/integrations/overview.md +143 -83
  273. package/docs/integrations/pinterest-tag.md +329 -0
  274. package/docs/integrations/pirsch.md +170 -160
  275. package/docs/integrations/plausible-analytics.md +173 -159
  276. package/docs/integrations/posthog.md +227 -242
  277. package/docs/integrations/promptwatch.md +155 -155
  278. package/docs/integrations/reddit-pixel.md +186 -158
  279. package/docs/integrations/rudderstack.md +202 -187
  280. package/docs/integrations/rybbit-analytics.md +172 -161
  281. package/docs/integrations/segment.md +183 -155
  282. package/docs/integrations/snapchat-pixel.md +187 -157
  283. package/docs/integrations/tiktok-pixel.md +172 -151
  284. package/docs/integrations/umami-analytics.md +164 -159
  285. package/docs/integrations/vercel-analytics.md +167 -158
  286. package/docs/integrations/x-pixel.md +177 -151
  287. package/docs/integrations/youtube.md +122 -87
  288. package/docs/upgrade-v3.md +490 -354
  289. package/package.json +12 -236
  290. package/dist-types/__tests__/helpers.d.ts +0 -141
  291. package/docs/assets/v3/brand-bar.png +0 -0
  292. package/docs/assets/v3/mobile-card.png +0 -0
  293. package/docs/assets/v3/preferences.png +0 -0
  294. package/docs/frameworks/javascript/script-loader.md +0 -94
  295. package/docs/frameworks/next/script-loader.md +0 -210
  296. package/docs/frameworks/react/script-loader.md +0 -63
  297. package/docs/guides/consent-state.md +0 -60
  298. package/docs/guides/deployment-modes.md +0 -75
  299. package/docs/integrations/clear-on-revocation.md +0 -167
  300. package/docs/integrations/granular-consent.md +0 -208
@@ -1,330 +1,2 @@
1
- import type { Script } from '@c15t/core';
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 bootstrap: [{
177
- readonly ifUndefined: true;
178
- readonly name: 'rudderanalytics';
179
- readonly type: 'setGlobal';
180
- readonly value: readonly [];
181
- }, {
182
- readonly name: 'RudderSnippetVersion';
183
- readonly type: 'setGlobal';
184
- readonly value: '3.0.32';
185
- }, {
186
- readonly name: 'rudderAnalyticsBuildType';
187
- readonly type: 'setGlobal';
188
- readonly value: 'modern';
189
- }, {
190
- readonly path: ["rudderanalytics", "snippetExecuted"];
191
- readonly type: 'setGlobalPath';
192
- readonly value: true;
193
- }, {
194
- readonly methods: ["setDefaultInstanceKey", "load", "ready", "page", "track", "identify", "alias", "group", "reset", "setAnonymousId", "startSession", "endSession", "consent", "addCustomIntegration"];
195
- readonly target: 'rudderanalytics';
196
- readonly type: 'defineQueueMethods';
197
- }];
198
- readonly category: 'measurement';
199
- readonly install: [{
200
- readonly args: ["{{writeKey}}", "{{dataPlaneUrl}}", "{{loadOptions}}"];
201
- readonly global: 'rudderanalytics';
202
- readonly method: 'load';
203
- readonly type: 'callGlobal';
204
- }, {
205
- readonly global: 'rudderanalytics';
206
- readonly method: 'page';
207
- readonly type: 'callGlobal';
208
- }, {
209
- readonly async: true;
210
- readonly attributes: {
211
- readonly 'data-loader': 'RS_JS_SDK';
212
- readonly 'data-rsa-write-key': '{{writeKey}}';
213
- };
214
- readonly src: '{{scriptUrl}}';
215
- readonly type: 'loadScript';
216
- }];
217
- readonly vendor: 'rudderstack';
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 const rudderstack: ({ writeKey, dataPlaneUrl, consentManagement, loadOptions, trackPageView, scriptUrl, }: RudderStackOptions) => Script;
330
- export {};
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/rudderstack. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/rudderstack';
@@ -1,82 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- rybbit?: {
5
- clearUserId: () => void;
6
- event: (name: string, properties?: Record<string, unknown>) => void;
7
- getUserId: () => string | null;
8
- identify: (userId: string) => void;
9
- pageview: () => void;
10
- };
11
- }
12
- }
13
- /**
14
- * Rybbit Analytics vendor manifest.
15
- *
16
- * Rybbit reads its configuration from script data attributes at load time.
17
- */
18
- export declare const rybbitAnalyticsManifest: {
19
- readonly kind: "c15t.vendor-manifest";
20
- readonly schemaVersion: 1;
21
- readonly category: 'measurement';
22
- readonly install: [{
23
- readonly attributes: {
24
- readonly 'data-api-key': '{{apiKey}}';
25
- readonly 'data-auto-track-pageview': '{{autoTrackPageview}}';
26
- readonly 'data-debounce': '{{debounce}}';
27
- readonly 'data-mask-patterns': '{{maskPatterns}}';
28
- readonly 'data-session-replay': '{{sessionReplay}}';
29
- readonly 'data-site-id': '{{siteId}}';
30
- readonly 'data-skip-patterns': '{{skipPatterns}}';
31
- readonly 'data-track-errors': '{{trackErrors}}';
32
- readonly 'data-track-outbound': '{{trackOutbound}}';
33
- readonly 'data-track-query': '{{trackQuery}}';
34
- readonly 'data-track-spa': '{{trackSpa}}';
35
- readonly 'data-web-vitals': '{{webVitals}}';
36
- };
37
- readonly defer: true;
38
- readonly src: '{{scriptUrl}}';
39
- readonly type: 'loadScript';
40
- }];
41
- readonly vendor: 'rybbit-analytics';
42
- };
43
- export interface RybbitAnalyticsOptions {
44
- /** Your Rybbit site ID. */
45
- siteId: string | number;
46
- /** Automatically track pageviews. */
47
- autoTrackPageview?: boolean;
48
- /** Enable SPA route tracking. */
49
- trackSpa?: boolean;
50
- /** Include query parameters in tracked URLs. */
51
- trackQuery?: boolean;
52
- /** Track outbound link clicks. */
53
- trackOutbound?: boolean;
54
- /** Track JavaScript errors. */
55
- trackErrors?: boolean;
56
- /** Enable session replay. */
57
- sessionReplay?: boolean;
58
- /** Enable Web Vitals tracking. */
59
- webVitals?: boolean;
60
- /** URL patterns to skip from tracking. */
61
- skipPatterns?: string[];
62
- /** URL patterns to mask in tracked data. */
63
- maskPatterns?: string[];
64
- /** Debounce interval for pageview tracking. */
65
- debounce?: number;
66
- /** API key for authenticated tracking. */
67
- apiKey?: string;
68
- /** Override the analytics host URL. */
69
- analyticsHost?: string;
70
- /** Custom loader URL. */
71
- scriptUrl?: string;
72
- }
73
- /**
74
- * Creates a Rybbit Analytics script.
75
- *
76
- * @param options - The options for the Rybbit Analytics script.
77
- * @returns The Rybbit Analytics script.
78
- * @throws {Error} Throws `rybbitAnalytics: missing siteId` when
79
- * `options.siteId` is undefined, null, or trims to an empty string. Provide a
80
- * valid non-empty site ID string to prevent this error.
81
- */
82
- export declare const rybbitAnalytics: (options: RybbitAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/rybbit-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/rybbit-analytics';
@@ -1,158 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- /**
3
- * Public Segment Analytics.js API exposed on `window.analytics`.
4
- *
5
- * Use this interface when interacting with Segment calls queued before or after
6
- * the client library is fully initialized.
7
- *
8
- * @example
9
- * ```ts
10
- * window.analytics.track('Signup', { plan: 'pro' });
11
- * ```
12
- */
13
- export interface SegmentApi {
14
- /**
15
- * Queues an event tracking call.
16
- *
17
- * @param event - Event name to record.
18
- * @param properties - Optional event properties payload.
19
- * @returns `void`.
20
- *
21
- * @remarks
22
- * Calls are queued until Analytics.js initializes.
23
- *
24
- * @example
25
- * ```ts
26
- * window.analytics.track('Signup', { plan: 'pro' });
27
- * ```
28
- */
29
- track: (event: string, properties?: Record<string, unknown>) => void;
30
- /**
31
- * Queues a page tracking call.
32
- *
33
- * @param name - Optional page name override.
34
- * @param properties - Optional page metadata payload.
35
- * @returns `void`.
36
- *
37
- * @remarks
38
- * If no name is passed, Segment infers the current page context.
39
- *
40
- * @example
41
- * ```ts
42
- * window.analytics.page('Pricing');
43
- * ```
44
- */
45
- page: (name?: string, properties?: Record<string, unknown>) => void;
46
- /**
47
- * Queues a user identification call.
48
- *
49
- * @param userId - Stable user identifier.
50
- * @param traits - Optional trait map associated with the user.
51
- * @param options - Optional Segment call options.
52
- * @returns `void`.
53
- *
54
- * @remarks
55
- * Ensure the client is initialized and use a stable `userId` to avoid
56
- * fragmented user profiles.
57
- *
58
- * @example
59
- * ```ts
60
- * window.analytics.identify('user_123', { email: 'dev@example.com' });
61
- * ```
62
- */
63
- identify: (userId: string, traits?: Record<string, unknown>, options?: Record<string, unknown>) => void;
64
- /**
65
- * Queues a group association call for account-level analytics.
66
- *
67
- * @param groupId - Group or account identifier.
68
- * @param traits - Optional group trait map.
69
- * @param options - Optional Segment call options.
70
- * @returns `void`.
71
- *
72
- * @example
73
- * ```ts
74
- * window.analytics.group('acme-inc', { plan: 'enterprise' });
75
- * ```
76
- */
77
- group: (groupId: string, traits?: Record<string, unknown>, options?: Record<string, unknown>) => void;
78
- /**
79
- * Queues a user alias call to merge identities.
80
- *
81
- * @param userId - New canonical user identifier.
82
- * @param previousId - Optional previous anonymous or legacy identifier.
83
- * @param options - Optional Segment call options.
84
- * @returns `void`.
85
- *
86
- * @remarks
87
- * Use `previousId` only when linking an existing anonymous identity to the
88
- * new `userId`.
89
- *
90
- * @example
91
- * ```ts
92
- * window.analytics.alias('user_123', 'anon_456');
93
- * ```
94
- */
95
- alias: (userId: string, previousId?: string, options?: Record<string, unknown>) => void;
96
- /**
97
- * Queues a reset call that clears current user identity state.
98
- *
99
- * @returns `void`.
100
- *
101
- * @example
102
- * ```ts
103
- * window.analytics.reset();
104
- * ```
105
- */
106
- reset: () => void;
107
- }
108
- declare global {
109
- interface Window {
110
- analytics?: SegmentApi;
111
- }
112
- }
113
- /**
114
- * Segment vendor manifest.
115
- *
116
- * Uses Segment's standard `window.analytics` queue shape and optionally queues
117
- * the initial `page()` call before the bundle loads.
118
- */
119
- export declare const segmentManifest: {
120
- readonly kind: "c15t.vendor-manifest";
121
- readonly schemaVersion: 1;
122
- readonly bootstrap: [{
123
- readonly ifUndefined: true;
124
- readonly name: 'analytics';
125
- readonly type: 'setGlobal';
126
- readonly value: readonly [];
127
- }, {
128
- readonly methods: ["track", "page", "identify", "group", "alias", "reset"];
129
- readonly target: 'analytics';
130
- readonly type: 'defineQueueMethods';
131
- }];
132
- readonly category: 'measurement';
133
- readonly install: [{
134
- readonly global: 'analytics';
135
- readonly method: 'page';
136
- readonly type: 'callGlobal';
137
- }, {
138
- readonly async: true;
139
- readonly src: '{{scriptUrl}}';
140
- readonly type: 'loadScript';
141
- }];
142
- readonly vendor: 'segment';
143
- };
144
- export interface SegmentOptions {
145
- /** Your Segment write key. */
146
- writeKey: string;
147
- /** Queue the initial `analytics.page()` call during setup. */
148
- trackPageView?: boolean;
149
- /** Optional full loader URL override. */
150
- scriptUrl?: string;
151
- }
152
- /**
153
- * Creates a Segment Analytics.js script.
154
- *
155
- * @param options - The options for the Segment script.
156
- * @returns The Segment script configuration.
157
- */
158
- export declare const segment: ({ writeKey, trackPageView, scriptUrl, }: SegmentOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/segment. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/segment';
@@ -1,93 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- umami?: {
5
- identify: (sessionData?: Record<string, unknown> | string) => void;
6
- track: {
7
- (payload?: Record<string, unknown>): void;
8
- (eventName: string, eventData?: Record<string, unknown>): void;
9
- };
10
- };
11
- }
12
- }
13
- /**
14
- * Umami Analytics vendor manifest.
15
- *
16
- * Configures Umami entirely through script `data-*` attributes. Umami is a
17
- * cookieless analytics product, so the script is consent-gated on
18
- * `measurement` and unloaded when consent is revoked.
19
- */
20
- export declare const umamiAnalyticsManifest: {
21
- readonly kind: "c15t.vendor-manifest";
22
- readonly schemaVersion: 1;
23
- readonly category: 'measurement';
24
- readonly install: [{
25
- readonly attributes: {
26
- readonly 'data-auto-track': '{{autoTrackAttribute}}';
27
- readonly 'data-before-send': '{{beforeSend}}';
28
- readonly 'data-domains': '{{domains}}';
29
- readonly 'data-host-url': '{{hostUrl}}';
30
- readonly 'data-tag': '{{tag}}';
31
- readonly 'data-website-id': '{{websiteId}}';
32
- };
33
- readonly defer: true;
34
- readonly src: '{{scriptUrl}}';
35
- readonly type: 'loadScript';
36
- }];
37
- readonly vendor: 'umami-analytics';
38
- };
39
- export interface UmamiAnalyticsOptions {
40
- /**
41
- * Your Umami website ID.
42
- */
43
- websiteId: string;
44
- /**
45
- * Override the host that receives analytics events.
46
- */
47
- hostUrl?: string;
48
- /**
49
- * Disable automatic tracking when set to `false`.
50
- */
51
- autoTrack?: boolean;
52
- /**
53
- * Restrict tracking to specific domains.
54
- */
55
- domains?: string[] | string;
56
- /**
57
- * Attach a tag to tracked events.
58
- */
59
- tag?: string;
60
- /**
61
- * Optional global hook name used for Umami's `data-before-send` attribute.
62
- *
63
- * Callback functions are intentionally not supported here because the c15t
64
- * manifest runtime cannot serialize custom JavaScript functions.
65
- */
66
- beforeSend?: string;
67
- /**
68
- * Custom loader URL.
69
- * @default 'https://cloud.umami.is/script.js'
70
- */
71
- scriptUrl?: string;
72
- }
73
- /**
74
- * Creates an Umami Analytics script.
75
- *
76
- * @see https://umami.is/docs/tracker-config
77
- *
78
- * @param options - The options for the Umami Analytics script.
79
- * @returns The Umami Analytics script.
80
- * @throws {Error} When `websiteId` is missing, empty, or invalid. Provide a
81
- * valid non-empty `websiteId` string to prevent this error.
82
- *
83
- * @example
84
- * ```ts
85
- * import { umamiAnalytics } from '@c15t/scripts/umami-analytics';
86
- *
87
- * umamiAnalytics({
88
- * websiteId: 'site-abc-123',
89
- * domains: ['example.com', 'www.example.com'],
90
- * });
91
- * ```
92
- */
93
- export declare const umamiAnalytics: (options: UmamiAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/umami-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/umami-analytics';