@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,75 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- import type { VendorManifest } from '../../types.js';
3
- declare global {
4
- interface Window {
5
- adobeDataLayer?: unknown[];
6
- _satellite?: Record<string, unknown>;
7
- }
8
- }
9
- /**
10
- * Adobe Analytics vendor manifest.
11
- *
12
- * Loads the Adobe Experience Platform Data Collection Tags embed script for a
13
- * specific property environment. Adobe does not provide a generic public
14
- * loader; each customer copies their own environment URL from Data Collection,
15
- * commonly hosted at `https://assets.adobedtm.com/.../launch-*.min.js`.
16
- */
17
- export declare const adobeAnalyticsManifest: VendorManifest;
18
- export interface AdobeAnalyticsOptions {
19
- /**
20
- * Adobe Experience Platform Data Collection web property embed URL.
21
- *
22
- * This must be the full `https:` URL from your Adobe Tags environment embed
23
- * code, commonly shaped like
24
- * `https://assets.adobedtm.com/{org}/{property}/launch-{env}.min.js`.
25
- * Self-hosted Launch/Tags embeds are supported as long as they use `https:`.
26
- */
27
- scriptUrl: string;
28
- /**
29
- * Load the Adobe Tags library asynchronously.
30
- *
31
- * Adobe recommends asynchronous deployment for most web properties. Set this
32
- * to `false` only for legacy synchronous setups that require ordered blocking
33
- * behavior.
34
- * @default true
35
- */
36
- async?: boolean;
37
- /**
38
- * Seed the Adobe Client Data Layer queue before the Tags library loads.
39
- *
40
- * When enabled, c15t creates `window.adobeDataLayer = []` only when the
41
- * global is still undefined. This matches Adobe Client Data Layer's default
42
- * object name and is harmless for properties that do not use the extension.
43
- * @default true
44
- */
45
- seedAdobeDataLayer?: boolean;
46
- }
47
- /**
48
- * Creates an Adobe Analytics script.
49
- *
50
- * @see https://experienceleague.adobe.com/en/docs/experience-platform/tags/publish/environments/environments
51
- * @see https://experienceleague.adobe.com/en/docs/experience-platform/tags/extensions/client/client-data-layer/overview
52
- *
53
- * @param options - The options for the Adobe Analytics script.
54
- * @returns The Adobe Analytics script.
55
- * @throws {Error} When `scriptUrl` is missing, empty, invalid, or not `https:`.
56
- * Copy the full web property embed URL from Adobe Data Collection and pass it
57
- * as `scriptUrl`.
58
- *
59
- * @remarks
60
- * Adobe Analytics is commonly deployed through Adobe Experience Platform Data
61
- * Collection Tags (formerly Launch). The loaded property may in turn load Adobe
62
- * Analytics, Web SDK, or other extensions and rules, so configure those Adobe
63
- * rules to respect your consent model too.
64
- *
65
- * @example
66
- * ```ts
67
- * import { adobeAnalytics } from '@c15t/scripts/adobe-analytics';
68
- *
69
- * adobeAnalytics({
70
- * scriptUrl:
71
- * 'https://assets.adobedtm.com/YOUR_ORG/YOUR_PROPERTY/launch-production.min.js',
72
- * });
73
- * ```
74
- */
75
- export declare const adobeAnalytics: (options: AdobeAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/adobe-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/adobe-analytics';
@@ -1,62 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- AhrefsAnalytics?: {
5
- sendEvent: (name: string, options?: {
6
- props?: Record<string, string>;
7
- meta?: Record<string, unknown>;
8
- }) => void;
9
- };
10
- }
11
- }
12
- /**
13
- * Ahrefs Analytics vendor manifest.
14
- *
15
- * Loads Ahrefs Web Analytics and passes the project key via `data-key`. Ahrefs
16
- * Web Analytics is cookieless, so the script is consent-gated on `measurement`
17
- * and unloaded when consent is revoked.
18
- */
19
- export declare const ahrefsAnalyticsManifest: {
20
- readonly kind: "c15t.vendor-manifest";
21
- readonly schemaVersion: 1;
22
- readonly category: 'measurement';
23
- readonly install: [{
24
- readonly async: true;
25
- readonly attributes: {
26
- readonly 'data-key': '{{key}}';
27
- };
28
- readonly src: '{{scriptUrl}}';
29
- readonly type: 'loadScript';
30
- }];
31
- readonly vendor: 'ahrefs-analytics';
32
- };
33
- export interface AhrefsAnalyticsOptions {
34
- /**
35
- * Your Ahrefs Web Analytics project key.
36
- */
37
- key: string;
38
- /**
39
- * Custom loader URL.
40
- * @default 'https://analytics.ahrefs.com/analytics.js'
41
- */
42
- scriptUrl?: string;
43
- }
44
- /**
45
- * Creates an Ahrefs Analytics script.
46
- *
47
- * The Ahrefs SDK exposes its runtime API on `window.AhrefsAnalytics` after
48
- * load. This helper only models the serializable script manifest.
49
- *
50
- * @see https://ahrefs.com/web-analytics
51
- *
52
- * @param options - The options for the Ahrefs Analytics script.
53
- * @returns The Ahrefs Analytics script.
54
- *
55
- * @example
56
- * ```ts
57
- * import { ahrefsAnalytics } from '@c15t/scripts/ahrefs-analytics';
58
- *
59
- * ahrefsAnalytics({ key: 'YOUR_PROJECT_KEY' });
60
- * ```
61
- */
62
- export declare const ahrefsAnalytics: (options: AhrefsAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/ahrefs-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/ahrefs-analytics';
@@ -1,234 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- /**
3
- * Browser SDK 2 version used by the default Amplitude CDN loader URL.
4
- *
5
- * The Amplitude Browser SDK 2 public bundle path is versioned. A
6
- * `analytics-browser-latest-min.js.gz` path is not publicly available, so c15t
7
- * pins a known Browser SDK 2 version by default and lets callers override the
8
- * loader through `scriptUrl`.
9
- */
10
- export declare const DEFAULT_AMPLITUDE_BROWSER_SDK_VERSION = "2.44.4";
11
- /**
12
- * Default Amplitude Browser SDK 2 loader URL.
13
- */
14
- export declare const DEFAULT_AMPLITUDE_SCRIPT_URL = "https://cdn.amplitude.com/libs/analytics-browser-2.44.4-min.js.gz";
15
- /**
16
- * Core Amplitude Browser SDK 2 methods queued before the real SDK loads.
17
- *
18
- * These methods use Amplitude's Browser SDK 2 snippet queue contract:
19
- * `window.amplitude._q` receives `{ name, args, resolve }` records, and the
20
- * loaded SDK drains that queue when `window.amplitude.invoked` is true.
21
- */
22
- export declare const AMPLITUDE_PROMISE_QUEUE_METHODS: readonly ['init', 'track', 'identify', 'flush'];
23
- /**
24
- * Queue methods Amplitude's snippet treats as synchronous — they queue the
25
- * call but return nothing.
26
- */
27
- export declare const AMPLITUDE_SYNC_QUEUE_METHODS: readonly ['setUserId', 'setOptOut'];
28
- export declare const AMPLITUDE_QUEUE_METHODS: readonly ["init", "track", "identify", "flush", "setUserId", "setOptOut"];
29
- /**
30
- * Amplitude Identify helper methods queued before the real SDK loads.
31
- */
32
- export declare const AMPLITUDE_IDENTIFY_METHODS: readonly ['set', 'setOnce', 'add', 'append', 'prepend', 'preInsert', 'postInsert', 'remove', 'unset', 'clearAll', 'getUserProperties'];
33
- /**
34
- * Queue entry consumed by Amplitude Browser SDK 2 at load time.
35
- */
36
- export interface AmplitudeQueueEntry {
37
- /** Name of the Amplitude method to invoke after the SDK loads. */
38
- name: (typeof AMPLITUDE_QUEUE_METHODS)[number];
39
- /** Arguments originally passed to the queued method. */
40
- args: unknown[];
41
- /** Promise resolver called by the SDK after the queued method runs. */
42
- resolve: (value: unknown) => void;
43
- }
44
- /**
45
- * Queue entry stored by an Amplitude Identify helper created before load.
46
- */
47
- export interface AmplitudeIdentifyQueueEntry {
48
- /** Identify helper method to replay after the SDK loads. */
49
- name: (typeof AMPLITUDE_IDENTIFY_METHODS)[number];
50
- /** Arguments originally passed to the helper method. */
51
- args: unknown[];
52
- }
53
- /**
54
- * Pre-load Amplitude Identify helper.
55
- */
56
- export interface AmplitudeIdentify {
57
- /** Queued Identify helper operations. */
58
- _q?: AmplitudeIdentifyQueueEntry[];
59
- /** Queue a `$set` identify operation. */
60
- set: (property: string, value: unknown) => this;
61
- /** Queue a `$setOnce` identify operation. */
62
- setOnce: (property: string, value: unknown) => this;
63
- /** Queue an `$add` identify operation. */
64
- add: (property: string, value: number) => this;
65
- /** Queue an `$append` identify operation. */
66
- append: (property: string, value: unknown) => this;
67
- /** Queue a `$prepend` identify operation. */
68
- prepend: (property: string, value: unknown) => this;
69
- /** Queue a `$preInsert` identify operation. */
70
- preInsert: (property: string, value: unknown) => this;
71
- /** Queue a `$postInsert` identify operation. */
72
- postInsert: (property: string, value: unknown) => this;
73
- /** Queue a `$remove` identify operation. */
74
- remove: (property: string, value: unknown) => this;
75
- /** Queue an `$unset` identify operation. */
76
- unset: (property: string) => this;
77
- /** Queue a `$clearAll` identify operation. */
78
- clearAll: () => this;
79
- /** Queue a read of the accumulated user property operations. */
80
- getUserProperties: () => this;
81
- }
82
- /**
83
- * Minimal public Amplitude Browser SDK 2 API exposed on `window.amplitude`.
84
- *
85
- * The real SDK replaces the pre-load stub with these methods after the loader
86
- * executes. Calls made before load return promises that resolve once the SDK
87
- * replays them.
88
- */
89
- export interface AmplitudeApi {
90
- /** Amplitude Browser SDK 2 pre-load queue. */
91
- _q?: AmplitudeQueueEntry[];
92
- /** Named-instance queue registry used by the official snippet contract. */
93
- _iq?: Record<string, unknown>;
94
- /** Marker that tells the SDK to replay snippet-queued calls. */
95
- invoked?: boolean;
96
- /** Pre-load Identify helper constructor. */
97
- Identify?: new () => AmplitudeIdentify;
98
- /** Initialize the default Amplitude instance. */
99
- init: (apiKey: string, options?: Record<string, unknown>) => Promise<unknown> | unknown;
100
- /** Track an event with optional event properties. */
101
- track: (eventInput: string | Record<string, unknown>, eventProperties?: Record<string, unknown>) => Promise<unknown> | unknown;
102
- /** Send an identify call. */
103
- identify: (identifyPayload: AmplitudeIdentify, eventOptions?: Record<string, unknown>) => Promise<unknown> | unknown;
104
- /** Set the current user identifier. */
105
- setUserId: (userId: string | undefined) => Promise<unknown> | unknown;
106
- /** Toggle runtime opt-out. */
107
- setOptOut: (optOut: boolean) => Promise<unknown> | unknown;
108
- /** Flush pending events. */
109
- flush: () => Promise<unknown> | unknown;
110
- }
111
- declare global {
112
- interface Window {
113
- amplitude?: AmplitudeApi;
114
- }
115
- }
116
- /**
117
- * Amplitude vendor manifest.
118
- *
119
- * Implements the essential Browser SDK 2 script-loader contract with
120
- * `window.amplitude.invoked`, an `_q` method-call queue, and an `_iq` registry
121
- * for named instances. It also defines the `Identify` queued helper used by
122
- * pre-load `identify()` calls. c15t gates the loader on `measurement` consent,
123
- * queues `init(apiKey, initOptions)` before the bundle loads, and uses
124
- * `setOptOut(false)` / `setOptOut(true)` for runtime consent changes after the
125
- * SDK has loaded.
126
- */
127
- export declare const amplitudeManifest: {
128
- readonly kind: "c15t.vendor-manifest";
129
- readonly schemaVersion: 1;
130
- readonly category: 'measurement';
131
- readonly install: [{
132
- readonly ifUndefined: true;
133
- readonly name: 'amplitude';
134
- readonly type: 'setGlobal';
135
- readonly value: {
136
- readonly _iq: {};
137
- readonly _q: readonly [];
138
- readonly invoked: true;
139
- };
140
- }, {
141
- readonly methods: ["set", "setOnce", "add", "append", "prepend", "preInsert", "postInsert", "remove", "unset", "clearAll", "getUserProperties"];
142
- readonly name: 'Identify';
143
- readonly queueProperty: '_q';
144
- readonly target: 'amplitude';
145
- readonly type: 'defineQueueClass';
146
- }, {
147
- readonly methods: ["init", "track", "identify", "flush"];
148
- readonly queue: {
149
- readonly property: '_q';
150
- };
151
- readonly queueFormat: 'wrappedMethodCall';
152
- readonly target: 'amplitude';
153
- readonly type: 'defineQueueMethods';
154
- }, {
155
- readonly type: 'defineQueueMethods';
156
- readonly target: 'amplitude';
157
- readonly queue: {
158
- readonly property: '_q';
159
- };
160
- readonly queueFormat: 'voidMethodCall';
161
- readonly methods: ["setUserId", "setOptOut"];
162
- }, {
163
- readonly args: ["{{apiKey}}", "{{initOptions}}"];
164
- readonly global: 'amplitude';
165
- readonly method: 'init';
166
- readonly type: 'callGlobal';
167
- }, {
168
- readonly async: true;
169
- readonly src: '{{scriptUrl}}';
170
- readonly type: 'loadScript';
171
- }];
172
- readonly onConsentDenied: [{
173
- readonly args: [true];
174
- readonly global: 'amplitude';
175
- readonly method: 'setOptOut';
176
- readonly type: 'callGlobal';
177
- }];
178
- readonly onConsentGranted: [{
179
- readonly args: [false];
180
- readonly global: 'amplitude';
181
- readonly method: 'setOptOut';
182
- readonly type: 'callGlobal';
183
- }];
184
- readonly onLoadDenied: [{
185
- readonly args: [true];
186
- readonly global: 'amplitude';
187
- readonly method: 'setOptOut';
188
- readonly type: 'callGlobal';
189
- }];
190
- readonly vendor: 'amplitude';
191
- };
192
- export interface AmplitudeOptions {
193
- /** Amplitude project API key. */
194
- apiKey: string;
195
- /**
196
- * Amplitude Browser SDK 2 initialization options.
197
- *
198
- * Values are serialized into the manifest, so use JSON-serializable values
199
- * only: plain objects, arrays, strings, numbers, booleans, and `null`.
200
- */
201
- initOptions?: Record<string, unknown>;
202
- /**
203
- * Optional Amplitude loader URL override.
204
- *
205
- * @default 'https://cdn.amplitude.com/libs/analytics-browser-2.44.4-min.js.gz'
206
- */
207
- scriptUrl?: string;
208
- }
209
- /**
210
- * Creates an Amplitude Browser SDK 2 script.
211
- *
212
- * @param options - The options for the Amplitude script.
213
- * @returns The Amplitude script configuration.
214
- * @throws {Error} When `apiKey` is missing or only whitespace.
215
- *
216
- * @remarks
217
- * The generated script is gated on `measurement` consent. It does not load the
218
- * Amplitude SDK until measurement consent is granted; after the SDK is loaded,
219
- * later consent changes call `amplitude.setOptOut(false)` or
220
- * `amplitude.setOptOut(true)`.
221
- *
222
- * @example
223
- * ```ts
224
- * import { amplitude } from '@c15t/scripts/amplitude';
225
- *
226
- * const script = amplitude({
227
- * apiKey: 'AMPLITUDE_API_KEY',
228
- * initOptions: {
229
- * autocapture: false,
230
- * },
231
- * });
232
- * ```
233
- */
234
- export declare const amplitude: ({ apiKey, initOptions, scriptUrl, }: AmplitudeOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/amplitude. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/amplitude';
@@ -1,60 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- /**
3
- * Clearbit vendor manifest.
4
- *
5
- * Loads Clearbit's visitor and company enrichment tag from the account-keyed
6
- * `tags.js` endpoint. Clearbit enrichment can identify visitors and companies,
7
- * so the default consent category is `marketing` rather than `measurement`.
8
- * The GitHub issue left the category open between measurement and marketing;
9
- * c15t treats enrichment and intent profiling as marketing-sensitive.
10
- */
11
- export declare const clearbitManifest: {
12
- readonly kind: "c15t.vendor-manifest";
13
- readonly schemaVersion: 1;
14
- readonly category: 'marketing';
15
- readonly install: [{
16
- readonly attributes: {
17
- readonly referrerpolicy: 'strict-origin-when-cross-origin';
18
- };
19
- readonly src: '{{scriptUrl}}';
20
- readonly type: 'loadScript';
21
- }];
22
- readonly vendor: 'clearbit';
23
- };
24
- export interface ClearbitOptions {
25
- /**
26
- * Your Clearbit publishable key.
27
- */
28
- publishableKey: string;
29
- /**
30
- * Custom loader URL.
31
- * @default `https://tag.clearbitscripts.com/v1/{publishableKey}/tags.js`
32
- */
33
- scriptUrl?: string;
34
- }
35
- /**
36
- * Creates a Clearbit enrichment script.
37
- *
38
- * @see https://help.clearbit.com/hc/en-us/articles/4420022080783 — installing the Clearbit tag
39
- *
40
- * @param options - The options for the Clearbit script.
41
- * @returns The Clearbit script.
42
- * @throws {Error} When `publishableKey` is missing, empty, or invalid.
43
- * Provide a valid non-empty `publishableKey` string to prevent this error.
44
- *
45
- * @remarks
46
- * Clearbit identifies visitors and companies for enrichment and intent use
47
- * cases. This helper therefore uses the `marketing` consent category by
48
- * default even though Clearbit is listed with analytics integrations for
49
- * discovery.
50
- *
51
- * @example
52
- * ```ts
53
- * import { clearbit } from '@c15t/scripts/clearbit';
54
- *
55
- * clearbit({
56
- * publishableKey: 'YOUR_PUBLISHABLE_KEY',
57
- * });
58
- * ```
59
- */
60
- export declare const clearbit: (options: ClearbitOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/clearbit. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/clearbit';
@@ -1,67 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- __cfBeacon?: {
5
- spa?: boolean;
6
- token: string;
7
- };
8
- }
9
- }
10
- /**
11
- * Cloudflare Web Analytics vendor manifest.
12
- *
13
- * Serializes Cloudflare's beacon config into the `data-cf-beacon` attribute.
14
- * Cloudflare Web Analytics is cookieless, so the script is consent-gated on
15
- * `measurement` and unloaded when consent is revoked.
16
- */
17
- export declare const cloudflareWebAnalyticsManifest: {
18
- readonly kind: "c15t.vendor-manifest";
19
- readonly schemaVersion: 1;
20
- readonly category: 'measurement';
21
- readonly install: [{
22
- readonly attributes: {
23
- readonly 'data-cf-beacon': '{{beaconConfig}}';
24
- };
25
- readonly defer: true;
26
- readonly src: '{{scriptUrl}}';
27
- readonly type: 'loadScript';
28
- }];
29
- readonly vendor: 'cloudflare-web-analytics';
30
- };
31
- export interface CloudflareWebAnalyticsOptions {
32
- /**
33
- * Your Cloudflare Web Analytics token.
34
- */
35
- token: string;
36
- /**
37
- * Enable Cloudflare's SPA route tracking.
38
- * @default true
39
- */
40
- spa?: boolean;
41
- /**
42
- * Custom loader URL.
43
- * @default 'https://static.cloudflareinsights.com/beacon.min.js'
44
- */
45
- scriptUrl?: string;
46
- }
47
- /**
48
- * Creates a Cloudflare Web Analytics script.
49
- *
50
- * @see https://developers.cloudflare.com/analytics/web-analytics/get-started/
51
- *
52
- * @param options - The options for the Cloudflare Web Analytics script.
53
- * @returns The Cloudflare Web Analytics script.
54
- * @throws {Error} Throws `cloudflareWebAnalytics: missing token` when
55
- * `options.token` is missing, invalid, or trims to an empty string.
56
- *
57
- * @example
58
- * ```ts
59
- * import { cloudflareWebAnalytics } from '@c15t/scripts/cloudflare-web-analytics';
60
- *
61
- * cloudflareWebAnalytics({
62
- * token: 'abc123...',
63
- * spa: true,
64
- * });
65
- * ```
66
- */
67
- export declare const cloudflareWebAnalytics: (options: CloudflareWebAnalyticsOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/cloudflare-web-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/cloudflare-web-analytics';
@@ -1,147 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- declare global {
3
- interface Window {
4
- databuddy?: {
5
- track: (eventName: string, properties?: Record<string, unknown>) => void;
6
- screenView: (screenName?: string, properties?: Record<string, unknown>) => void;
7
- clear: () => void;
8
- flush: () => void;
9
- setGlobalProperties: (properties: Record<string, unknown>) => void;
10
- trackCustomEvent: (eventName: string, properties?: Record<string, unknown>) => void;
11
- options: {
12
- disabled: boolean;
13
- [key: string]: unknown;
14
- };
15
- };
16
- databuddyConfig?: {
17
- clientId?: string;
18
- apiUrl?: string;
19
- [key: string]: unknown;
20
- };
21
- }
22
- }
23
- /**
24
- * DataBuddy vendor manifest.
25
- *
26
- * DataBuddy always loads but controls tracking via its `options.disabled` flag.
27
- * Config is seeded via `window.databuddyConfig` before the script loads.
28
- */
29
- export declare const databuddyManifest: {
30
- readonly kind: "c15t.vendor-manifest";
31
- readonly schemaVersion: 1;
32
- readonly alwaysLoad: true;
33
- readonly category: 'measurement';
34
- readonly install: [{
35
- readonly async: true;
36
- readonly attributes: {
37
- readonly crossorigin: 'anonymous';
38
- readonly 'data-api-url': '{{apiUrl}}';
39
- readonly 'data-client-id': '{{clientId}}';
40
- };
41
- readonly src: '{{scriptUrl}}';
42
- readonly type: 'loadScript';
43
- }];
44
- readonly onBeforeLoadDenied: [{
45
- readonly ifUndefined: true;
46
- readonly name: 'databuddyConfig';
47
- readonly type: 'setGlobal';
48
- readonly value: '{{configWhenDenied}}';
49
- }];
50
- readonly onBeforeLoadGranted: [{
51
- readonly ifUndefined: true;
52
- readonly name: 'databuddyConfig';
53
- readonly type: 'setGlobal';
54
- readonly value: '{{configWhenGranted}}';
55
- }];
56
- readonly onConsentDenied: [{
57
- readonly ifUndefined: false;
58
- readonly name: 'databuddyConfig';
59
- readonly type: 'setGlobal';
60
- readonly value: '{{configWhenDenied}}';
61
- }, {
62
- readonly path: ["databuddy", "options", "disabled"];
63
- readonly type: 'setGlobalPath';
64
- readonly value: true;
65
- }];
66
- readonly onConsentGranted: [{
67
- readonly ifUndefined: false;
68
- readonly name: 'databuddyConfig';
69
- readonly type: 'setGlobal';
70
- readonly value: '{{configWhenGranted}}';
71
- }, {
72
- readonly path: ["databuddy", "options", "disabled"];
73
- readonly type: 'setGlobalPath';
74
- readonly value: false;
75
- }];
76
- readonly onLoadDenied: [{
77
- readonly path: ["databuddy", "options", "disabled"];
78
- readonly type: 'setGlobalPath';
79
- readonly value: true;
80
- }];
81
- readonly onLoadGranted: [{
82
- readonly path: ["databuddy", "options", "disabled"];
83
- readonly type: 'setGlobalPath';
84
- readonly value: false;
85
- }];
86
- readonly vendor: 'databuddy';
87
- };
88
- export interface DatabuddyConsentOptions {
89
- /**
90
- * Your Databuddy client ID.
91
- */
92
- clientId: string;
93
- /**
94
- * Your Databuddy API URL.
95
- * @default 'https://basket.databuddy.cc'
96
- */
97
- apiUrl?: string;
98
- /**
99
- * The Databuddy script URL.
100
- * @default 'https://cdn.databuddy.cc/databuddy.js'
101
- */
102
- scriptUrl?: string;
103
- /** Databuddy config object to seed when consent is granted at load time. */
104
- configWhenGranted: Record<string, unknown>;
105
- /** Databuddy config object to seed when consent is denied at load time. */
106
- configWhenDenied: Record<string, unknown>;
107
- }
108
- /**
109
- * Loads the Databuddy script and manages consent state declaratively via the manifest runtime.
110
- *
111
- * The script always loads (`alwaysLoad: true`) but tracking is controlled via the `disabled`
112
- * flag on Databuddy's global config/runtime objects, allowing the vendor to stay present in
113
- * the DOM while respecting consent boundaries.
114
- *
115
- * @param options - Configuration for the Databuddy consent script
116
- * @returns The Databuddy script configuration object for c15t's script loader
117
- *
118
- * @example
119
- * ```ts
120
- * import { createConsentKernel } from 'c15t';
121
- * import { createScriptLoader } from 'c15t/modules/script-loader';
122
- * import { databuddy } from '@c15t/scripts/databuddy';
123
- *
124
- * const kernel = createConsentKernel();
125
- * const loader = createScriptLoader({
126
- * kernel,
127
- * scripts: [
128
- * databuddy({
129
- * clientId: 'db_1234567890abcdef',
130
- * configWhenGranted: {
131
- * clientId: 'db_1234567890abcdef',
132
- * trackScreenViews: true,
133
- * trackOutgoingLinks: true,
134
- * trackPerformance: true,
135
- * samplingRate: 1.0,
136
- * disabled: false,
137
- * },
138
- * configWhenDenied: {
139
- * clientId: 'db_1234567890abcdef',
140
- * disabled: true,
141
- * },
142
- * }),
143
- * ],
144
- * });
145
- * ```
146
- */
147
- export declare const databuddy: (options: DatabuddyConsentOptions) => Script;
1
+ /** @deprecated Use @c15t/integrations/vendors/analytics/databuddy. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/analytics/databuddy';