@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,113 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- mixpanel?: {
5
- init: (token: string, config?: Record<string, unknown>) => void;
6
- track: (event: string, properties?: Record<string, unknown>) => void;
7
- identify: (distinctId: string) => void;
8
- reset: () => void;
9
- register: (properties: Record<string, unknown>) => void;
10
- opt_in_tracking: () => void;
11
- opt_out_tracking: () => void;
12
- /** Snippet version marker consumed by `init_from_snippet`. */
13
- __SV?: number;
14
- /** Pending `[token, config, instanceName]` init tuples consumed at SDK load. */
15
- _i?: unknown[][];
16
- };
17
- }
18
- }
19
- /**
20
- * Mixpanel vendor manifest.
21
- *
22
- * Implements the official snippet contract: the stub array carries the
23
- * snippet version marker (`__SV`) and the pending `[token, config, 'mixpanel']`
24
- * init tuple in `_i`, which `mixpanel-2-latest.min.js` consumes at load time via
25
- * `init_from_snippet`. Without `__SV` the SDK logs "Mixpanel error: Version
26
- * mismatch" and never initializes, silently dropping queued calls.
27
- *
28
- * Mixpanel can stay loaded across consent changes and toggle tracking with its
29
- * own opt-in and opt-out APIs.
30
- */
31
- export declare const mixpanelAnalyticsManifest: {
32
- readonly kind: "c15t.vendor-manifest";
33
- readonly schemaVersion: 1;
34
- readonly alwaysLoad: true;
35
- readonly category: 'measurement';
36
- readonly install: [{
37
- readonly ifUndefined: true;
38
- readonly name: 'mixpanel';
39
- readonly type: 'setGlobal';
40
- readonly value: readonly [];
41
- }, {
42
- readonly path: ["mixpanel", "__SV"];
43
- readonly type: 'setGlobalPath';
44
- readonly value: 1.2;
45
- }, {
46
- readonly path: ["mixpanel", "_i"];
47
- readonly type: 'setGlobalPath';
48
- readonly value: readonly [readonly ["{{token}}", "{{initOptions}}", "mixpanel"]];
49
- }, {
50
- readonly methods: ["track", "identify", "reset", "register", "opt_in_tracking", "opt_out_tracking"];
51
- readonly target: 'mixpanel';
52
- readonly type: 'defineQueueMethods';
53
- }, {
54
- readonly async: true;
55
- readonly src: '{{scriptUrl}}';
56
- readonly type: 'loadScript';
57
- }];
58
- readonly onConsentDenied: [{
59
- readonly global: 'mixpanel';
60
- readonly method: 'opt_out_tracking';
61
- readonly type: 'callGlobal';
62
- }];
63
- readonly onConsentGranted: [{
64
- readonly global: 'mixpanel';
65
- readonly method: 'opt_in_tracking';
66
- readonly type: 'callGlobal';
67
- }];
68
- readonly onLoadDenied: [{
69
- readonly global: 'mixpanel';
70
- readonly method: 'opt_out_tracking';
71
- readonly type: 'callGlobal';
72
- }];
73
- readonly onLoadGranted: [{
74
- readonly global: 'mixpanel';
75
- readonly method: 'opt_in_tracking';
76
- readonly type: 'callGlobal';
77
- }];
78
- readonly vendor: 'mixpanel-analytics';
79
- };
80
- export interface MixpanelAnalyticsOptions {
81
- /** Your Mixpanel project token. */
82
- token: string;
83
- /**
84
- * Mixpanel init options passed after the library loads.
85
- *
86
- * The manifest engine serializes this object as a template variable, so use
87
- * JSON-serializable values only (no functions, class instances, prototypes,
88
- * `Map`, `Set`, or other non-JSON types). Named instances and nested
89
- * `people.*` queue helpers are intentionally out of scope for this helper.
90
- */
91
- initOptions?: Record<string, unknown>;
92
- /** Mixpanel loader URL. */
93
- scriptUrl?: string;
94
- }
95
- /**
96
- * Creates a Mixpanel Analytics script.
97
- *
98
- * @param options - The options for the Mixpanel Analytics script.
99
- * @returns The Mixpanel Analytics script configuration.
100
- * @throws {Error} Throws when `token` is not a non-empty 32-character
101
- * hexadecimal Mixpanel project token.
102
- *
103
- * @example
104
- * ```ts
105
- * import { mixpanelAnalytics } from '@c15t/scripts/mixpanel-analytics';
106
- *
107
- * const script = mixpanelAnalytics({
108
- * token: '1234567890abcdef1234567890abcdef',
109
- * initOptions: { debug: true },
110
- * });
111
- * ```
112
- */
113
- export declare const mixpanelAnalytics: ({ token, initOptions, scriptUrl, }: MixpanelAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/mixpanel-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/mixpanel-analytics';
@@ -0,0 +1,2 @@
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/one-dollar-stats. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/one-dollar-stats';
@@ -1,96 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- pirsch?: (eventName: string, options?: {
5
- duration?: number;
6
- meta?: Record<string, unknown>;
7
- non_interactive?: boolean;
8
- }) => Promise<null | undefined>;
9
- pirschClearSession?: () => void;
10
- pirschInit?: () => void;
11
- pirschNotFound?: () => void;
12
- }
13
- }
14
- /**
15
- * Pirsch vendor manifest.
16
- *
17
- * Configures Pirsch through script attributes. Pirsch finds the script element
18
- * by a fixed element id, so the `id` attribute is part of the loader contract.
19
- */
20
- export declare const pirschManifest: {
21
- readonly kind: "c15t.vendor-manifest";
22
- readonly schemaVersion: 1;
23
- readonly category: 'measurement';
24
- readonly install: [{
25
- readonly attributes: {
26
- readonly 'data-code': '{{identificationCode}}';
27
- readonly 'data-dev': '{{dev}}';
28
- readonly 'data-disable-page-views': '{{disablePageViews}}';
29
- readonly 'data-domain': '{{domain}}';
30
- readonly 'data-event-endpoint': '{{eventEndpoint}}';
31
- readonly 'data-hit-endpoint': '{{hitEndpoint}}';
32
- readonly id: '{{scriptElementId}}';
33
- };
34
- readonly defer: true;
35
- readonly src: '{{scriptUrl}}';
36
- readonly type: 'loadScript';
37
- }];
38
- readonly vendor: 'pirsch';
39
- };
40
- export interface PirschOptions {
41
- /**
42
- * Your Pirsch identification code.
43
- */
44
- identificationCode: string;
45
- /**
46
- * Additional dashboard domains, optionally including per-domain codes.
47
- *
48
- * Arrays are serialized as Pirsch's comma-separated `data-domain` value.
49
- */
50
- domain?: string | string[];
51
- /**
52
- * Enable localhost testing by rewriting the tracked hostname.
53
- */
54
- dev?: string;
55
- /**
56
- * Custom pageview endpoint.
57
- */
58
- hitEndpoint?: string;
59
- /**
60
- * Custom event endpoint.
61
- */
62
- eventEndpoint?: string;
63
- /**
64
- * Disable automatic pageview tracking.
65
- */
66
- disablePageViews?: boolean;
67
- /**
68
- * Load Pirsch's extended script variant.
69
- */
70
- extended?: boolean;
71
- /**
72
- * Custom loader URL.
73
- */
74
- scriptUrl?: string;
75
- }
76
- /**
77
- * Creates a Pirsch Analytics script.
78
- *
79
- * @see https://docs.pirsch.io/get-started/frontend-integration
80
- *
81
- * @param options - The options for the Pirsch script.
82
- * @returns The Pirsch script.
83
- * @throws {Error} When `identificationCode` is missing, empty, or invalid.
84
- * Provide a valid non-empty `identificationCode` string to prevent this error.
85
- *
86
- * @example
87
- * ```ts
88
- * import { pirsch } from '@c15t/scripts/pirsch';
89
- *
90
- * pirsch({
91
- * identificationCode: 'YOUR_IDENTIFICATION_CODE',
92
- * domain: 'rollup.example.com:ROLLUP_CODE',
93
- * });
94
- * ```
95
- */
96
- export declare const pirsch: (options: PirschOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/pirsch. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/pirsch';
@@ -1,122 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- export type PlausibleExtension = 'hash' | 'outbound-links' | 'file-downloads' | 'tagged-events' | 'revenue' | 'pageview-props' | 'compat' | 'local' | 'manual';
3
- export interface PlausibleInitOptions {
4
- customProperties?: Record<string, unknown>;
5
- endpoint?: string;
6
- fileDownloads?: {
7
- fileExtensions?: string[];
8
- };
9
- hashBasedRouting?: boolean;
10
- autoCapturePageviews?: boolean;
11
- captureOnLocalhost?: boolean;
12
- }
13
- declare global {
14
- interface Window {
15
- plausible?: ((...args: unknown[]) => void) & {
16
- o?: PlausibleInitOptions;
17
- q?: unknown[][];
18
- };
19
- }
20
- }
21
- /**
22
- * Plausible Analytics vendor manifest.
23
- *
24
- * Seeds a small queue stub so early `window.plausible(...)` calls can be
25
- * buffered before the real tracker loads. Plausible is cookieless and only
26
- * tracks page views, so the script is gated on `measurement` consent and is
27
- * unloaded when consent is revoked.
28
- */
29
- export declare const plausibleAnalyticsManifest: {
30
- readonly kind: "c15t.vendor-manifest";
31
- readonly schemaVersion: 1;
32
- readonly bootstrap: [{
33
- readonly ifUndefined: true;
34
- readonly name: 'plausible';
35
- readonly properties: {
36
- readonly o: '{{initOptions}}';
37
- };
38
- readonly queue: {
39
- readonly property: 'q';
40
- };
41
- readonly queueFormat: 'array';
42
- readonly type: 'defineStubFunction';
43
- }];
44
- readonly category: 'measurement';
45
- readonly install: [{
46
- readonly attributes: {
47
- readonly 'data-api': '{{apiAttribute}}';
48
- readonly 'data-domain': '{{domain}}';
49
- };
50
- readonly defer: true;
51
- readonly src: '{{scriptUrl}}';
52
- readonly type: 'loadScript';
53
- }];
54
- readonly vendor: 'plausible-analytics';
55
- };
56
- export interface PlausibleAnalyticsOptions {
57
- /**
58
- * Unique Plausible script ID for the new script format.
59
- */
60
- scriptId?: string;
61
- /**
62
- * Legacy domain-based site identifier.
63
- */
64
- domain?: string;
65
- /**
66
- * Legacy script extensions.
67
- */
68
- extension?: PlausibleExtension | PlausibleExtension[];
69
- /**
70
- * Properties tracked with each pageview.
71
- */
72
- customProperties?: Record<string, unknown>;
73
- /**
74
- * Custom tracking endpoint.
75
- */
76
- endpoint?: string;
77
- /**
78
- * File download tracking configuration.
79
- */
80
- fileDownloads?: {
81
- fileExtensions?: string[];
82
- };
83
- /**
84
- * Enable hash-based routing support.
85
- */
86
- hashBasedRouting?: boolean;
87
- /**
88
- * Disable automatic pageview capture when set to `false`.
89
- */
90
- autoCapturePageviews?: boolean;
91
- /**
92
- * Enable tracking on localhost.
93
- */
94
- captureOnLocalhost?: boolean;
95
- /**
96
- * Custom loader URL.
97
- */
98
- scriptUrl?: string;
99
- }
100
- /**
101
- * Creates a Plausible Analytics script.
102
- *
103
- * Models Plausible's queue bootstrap and loader attributes as a c15t-managed
104
- * script. Supports both the new `scriptId`-based loader and the legacy
105
- * `domain` + extension-based loader.
106
- *
107
- * @see https://plausible.io/docs/script-extensions
108
- *
109
- * @param options - The options for the Plausible Analytics script.
110
- * @returns The Plausible Analytics script.
111
- *
112
- * @example
113
- * ```ts
114
- * import { plausibleAnalytics } from '@c15t/scripts/plausible-analytics';
115
- *
116
- * plausibleAnalytics({
117
- * domain: 'example.com',
118
- * extension: ['file-downloads', 'outbound-links'],
119
- * });
120
- * ```
121
- */
122
- export declare const plausibleAnalytics: (options: PlausibleAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/plausible-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/plausible-analytics';
@@ -1,175 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- posthog: {
5
- init: (token: string, options: {
6
- api_host: string;
7
- ui_host?: string;
8
- autocapture?: boolean;
9
- [key: string]: unknown;
10
- }) => void;
11
- opt_in_capturing: () => void;
12
- opt_out_capturing: () => void;
13
- get_explicit_consent_status: () => string;
14
- capture: (event: string, properties?: Record<string, unknown>) => void;
15
- /**
16
- * Pending `[token, config, instanceName]` init tuples, as seeded by
17
- * the official PostHog snippet. `array.js` only installs its runtime
18
- * over an existing `window.posthog` when this is an array.
19
- */
20
- _i?: unknown[][];
21
- };
22
- }
23
- }
24
- export type PosthogRegion = 'eu' | 'us';
25
- export type PosthogLoadMode = 'always' | 'after-consent' | 'disabled';
26
- /**
27
- * PostHog vendor manifest.
28
- *
29
- * By default, PostHog manages its own consent internally via
30
- * opt_in/opt_out capturing. The helper can also gate loading until
31
- * measurement consent is granted.
32
- */
33
- export declare const posthogManifest: {
34
- readonly kind: "c15t.vendor-manifest";
35
- readonly schemaVersion: 1;
36
- readonly alwaysLoad: true;
37
- readonly bootstrap: [{
38
- readonly ifUndefined: true;
39
- readonly name: 'posthog';
40
- readonly type: 'setGlobal';
41
- readonly value: readonly [];
42
- }, {
43
- readonly ifGlobalIsQueue: true;
44
- readonly path: ["posthog", "_i"];
45
- readonly type: 'setGlobalPath';
46
- readonly value: readonly [readonly ["{{id}}", "{{initOptions}}", "posthog"]];
47
- }, {
48
- readonly ifGlobalIsQueue: true;
49
- readonly path: ["posthog", "people"];
50
- readonly type: 'setGlobalPath';
51
- readonly value: readonly [];
52
- }, {
53
- readonly methods: ["capture", "opt_in_capturing", "opt_out_capturing"];
54
- readonly target: 'posthog';
55
- readonly type: 'defineQueueMethods';
56
- }, {
57
- readonly ifGlobalIsQueue: true;
58
- readonly methods: [{
59
- readonly behavior: 'noop';
60
- readonly name: 'init';
61
- }, {
62
- readonly behavior: 'return';
63
- readonly name: 'get_explicit_consent_status';
64
- readonly value: 'pending';
65
- }];
66
- readonly target: 'posthog';
67
- readonly type: 'defineGlobalMethods';
68
- }];
69
- readonly category: 'measurement';
70
- readonly install: [{
71
- readonly async: true;
72
- readonly attributes: {
73
- readonly crossorigin: 'anonymous';
74
- readonly 'data-api-host': '{{apiHost}}';
75
- readonly 'data-ui-host': '{{uiHost}}';
76
- };
77
- readonly src: '{{scriptUrl}}';
78
- readonly type: 'loadScript';
79
- }];
80
- readonly onBeforeLoadDenied: [{
81
- readonly queue: 'posthog';
82
- readonly type: 'pushToQueue';
83
- readonly value: readonly ["opt_out_capturing"];
84
- }];
85
- readonly onBeforeLoadGranted: [{
86
- readonly queue: 'posthog';
87
- readonly type: 'pushToQueue';
88
- readonly value: readonly ["opt_in_capturing", {
89
- readonly captureEventName: null;
90
- }];
91
- }];
92
- readonly onConsentDenied: [{
93
- readonly global: 'posthog';
94
- readonly method: 'opt_out_capturing';
95
- readonly type: 'callGlobal';
96
- }];
97
- readonly onConsentGranted: [{
98
- readonly global: 'posthog';
99
- readonly method: 'opt_in_capturing';
100
- readonly type: 'callGlobal';
101
- }];
102
- readonly onLoadDenied: [{
103
- readonly global: 'posthog';
104
- readonly method: 'opt_out_capturing';
105
- readonly type: 'callGlobal';
106
- }];
107
- readonly onLoadGranted: [{
108
- readonly args: [{
109
- readonly captureEventName: null;
110
- }];
111
- readonly global: 'posthog';
112
- readonly method: 'opt_in_capturing';
113
- readonly type: 'callGlobal';
114
- }];
115
- readonly vendor: 'posthog';
116
- };
117
- export interface PosthogConsentOptions {
118
- /**
119
- * Your posthog id, begins with 'phc_'.
120
- */
121
- id: string;
122
- /**
123
- * PostHog Cloud region used to derive hosts when explicit host options are not
124
- * provided.
125
- * @default 'eu'
126
- */
127
- region?: PosthogRegion;
128
- /**
129
- * Your posthog api host.
130
- * @default 'https://eu.i.posthog.com'
131
- */
132
- apiHost?: string;
133
- /**
134
- * Your PostHog UI host. Defaults to the UI host for the selected region or
135
- * inferred API host region.
136
- */
137
- uiHost?: string;
138
- /** The PostHog array loader URL. */
139
- scriptUrl?: string;
140
- /**
141
- * How c15t should load the PostHog script.
142
- *
143
- * - `always`: load immediately and synchronize consent through PostHog APIs.
144
- * - `after-consent`: wait for measurement consent before loading PostHog.
145
- * - `disabled`: return an inert callback-only script with no network request.
146
- *
147
- * @default 'always'
148
- */
149
- loadMode?: PosthogLoadMode;
150
- /** PostHog init options passed to `posthog.init(...)`. */
151
- initOptions?: Record<string, unknown>;
152
- }
153
- /**
154
- * Creates a c15t PostHog script helper.
155
- *
156
- * The `posthog()` helper uses `region` to resolve the PostHog API, UI, and
157
- * bootstrap script hosts. By default, `loadMode: 'always'` loads PostHog
158
- * immediately and syncs consent with `posthog.opt_in_capturing()` or
159
- * `posthog.opt_out_capturing()`.
160
- *
161
- * With `loadMode: 'after-consent'`, the script is consent-gated and c15t calls
162
- * `posthog.opt_in_capturing()` or `posthog.opt_out_capturing()` after load
163
- * based on the user's measurement consent. With `loadMode: 'disabled'`, no
164
- * PostHog script is loaded and no `posthog.opt_in_capturing()` or
165
- * `posthog.opt_out_capturing()` calls are made.
166
- *
167
- * Edge case: `loadMode: 'disabled'` skips consent-related flows entirely; use it
168
- * only when consumers manage PostHog loading and consent externally.
169
- *
170
- * @see https://posthog.com/docs/libraries/js#opt-in-capturing
171
- *
172
- * @param options - Optional configuration for the PostHog consent script
173
- * @returns The Posthog script
174
- */
175
- export declare const posthog: (options: PosthogConsentOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/posthog. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/posthog';
@@ -1,36 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- /**
3
- * Promptwatch vendor manifest.
4
- *
5
- * Loads the Promptwatch client with your project id on the script element.
6
- */
7
- export declare const promptwatchManifest: {
8
- readonly kind: "c15t.vendor-manifest";
9
- readonly schemaVersion: 1;
10
- readonly category: 'measurement';
11
- readonly install: [{
12
- readonly async: true;
13
- readonly attributes: {
14
- readonly 'data-project-id': '{{projectId}}';
15
- };
16
- readonly src: '{{scriptUrl}}';
17
- readonly type: 'loadScript';
18
- }];
19
- readonly vendor: 'promptwatch';
20
- };
21
- export interface PromptwatchOptions {
22
- /** Your Promptwatch project id (UUID from the Promptwatch dashboard). */
23
- projectId: string;
24
- /** Promptwatch client script URL. */
25
- scriptUrl?: string;
26
- }
27
- /**
28
- * Promptwatch analytics script for AI traffic and usage insights.
29
- *
30
- * @param options - Promptwatch integration options.
31
- * @param options.projectId - Promptwatch project id from your dashboard.
32
- * @param options.scriptUrl - Optional custom script URL override.
33
- * @throws {Error} When `projectId` is empty or only whitespace.
34
- * @returns The Promptwatch script configuration.
35
- */
36
- export declare const promptwatch: ({ projectId, scriptUrl, }: PromptwatchOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/promptwatch. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/promptwatch';