@c15t/scripts 3.0.0-alpha.2 → 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 -63
  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 -139
  13. package/dist/engine/compile.js +2 -89
  14. package/dist/engine/runtime.js +2 -448
  15. package/dist/events.js +2 -218
  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 -422
  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 -123
  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 -78
  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 -30
  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 -65
  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 -64
  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 -73
  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 -46
  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 -485
  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 -295
  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 -95
  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 -39
  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 -164
  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 -62
  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 -96
  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 -63
  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/{guides → concepts}/consent-state.md +71 -101
  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 -34
  207. package/docs/customization/recipes.md +839 -49
  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 +163 -96
  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 +167 -159
  245. package/docs/integrations/ahrefs-analytics.md +152 -154
  246. package/docs/integrations/amplitude.md +162 -156
  247. package/docs/integrations/building-integrations.md +136 -37
  248. package/docs/integrations/clearbit.md +154 -154
  249. package/docs/integrations/cloudflare-web-analytics.md +156 -156
  250. package/docs/integrations/cloudflare-zaraz.md +209 -261
  251. package/docs/integrations/crisp.md +164 -158
  252. package/docs/integrations/databuddy.md +157 -173
  253. package/docs/integrations/fathom-analytics.md +158 -156
  254. package/docs/integrations/front-chat.md +167 -167
  255. package/docs/integrations/google-maps.md +118 -83
  256. package/docs/integrations/google-tag-manager.md +178 -163
  257. package/docs/integrations/google-tag.md +163 -160
  258. package/docs/integrations/heap.md +163 -155
  259. package/docs/integrations/hightouch.md +161 -157
  260. package/docs/integrations/hotjar.md +159 -155
  261. package/docs/integrations/intercom.md +183 -153
  262. package/docs/integrations/klaviyo.md +486 -0
  263. package/docs/integrations/linkedin-insights.md +174 -150
  264. package/docs/integrations/logrocket.md +160 -156
  265. package/docs/integrations/matomo-analytics.md +188 -178
  266. package/docs/integrations/meta-pixel.md +188 -150
  267. package/docs/integrations/microsoft-clarity.md +163 -155
  268. package/docs/integrations/microsoft-uet.md +148 -154
  269. package/docs/integrations/mixpanel-analytics.md +155 -160
  270. package/docs/integrations/one-dollar-stats.md +166 -165
  271. package/docs/integrations/openai-pixel.md +204 -301
  272. package/docs/integrations/overview.md +137 -80
  273. package/docs/integrations/pinterest-tag.md +191 -183
  274. package/docs/integrations/pirsch.md +169 -159
  275. package/docs/integrations/plausible-analytics.md +172 -158
  276. package/docs/integrations/posthog.md +226 -241
  277. package/docs/integrations/promptwatch.md +154 -154
  278. package/docs/integrations/reddit-pixel.md +185 -157
  279. package/docs/integrations/rudderstack.md +201 -186
  280. package/docs/integrations/rybbit-analytics.md +171 -160
  281. package/docs/integrations/segment.md +182 -154
  282. package/docs/integrations/snapchat-pixel.md +186 -156
  283. package/docs/integrations/tiktok-pixel.md +171 -150
  284. package/docs/integrations/umami-analytics.md +163 -158
  285. package/docs/integrations/vercel-analytics.md +166 -157
  286. package/docs/integrations/x-pixel.md +176 -150
  287. package/docs/integrations/youtube.md +121 -86
  288. package/docs/upgrade-v3.md +475 -467
  289. package/package.json +10 -257
  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 -100
  295. package/docs/frameworks/next/script-loader.md +0 -216
  296. package/docs/frameworks/react/script-loader.md +0 -69
  297. package/docs/guides/deployment-modes.md +0 -75
  298. package/docs/guides/shared-consent-controls.md +0 -158
  299. package/docs/integrations/clear-on-revocation.md +0 -167
  300. package/docs/integrations/granular-consent.md +0 -210
@@ -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';
@@ -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';