@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,314 +1,2 @@
1
- import type { AllConsentNames, HasCondition } from '@c15t/core';
2
- export declare const VENDOR_MANIFEST_KIND = "c15t.vendor-manifest";
3
- export declare const VENDOR_MANIFEST_SCHEMA_VERSION = 1;
4
- export declare const vendorManifestContract: {
5
- readonly kind: "c15t.vendor-manifest";
6
- readonly schemaVersion: 1;
7
- };
8
- export declare const RUNTIME_VALUE_KIND = "c15t.runtime-value";
9
- export interface RuntimeValue {
10
- kind: typeof RUNTIME_VALUE_KIND;
11
- value: 'date' | 'timestamp';
12
- }
13
- export declare const runtimeDateValue: {
14
- readonly kind: "c15t.runtime-value";
15
- readonly value: 'date';
16
- };
17
- export declare const runtimeTimestampValue: {
18
- readonly kind: "c15t.runtime-value";
19
- readonly value: 'timestamp';
20
- };
21
- export interface ManifestContract {
22
- kind: typeof VENDOR_MANIFEST_KIND;
23
- schemaVersion: typeof VENDOR_MANIFEST_SCHEMA_VERSION;
24
- }
25
- type ManifestInterpolationToken = `{{${string}}}`;
26
- export type ManifestCategoryCondition = HasCondition<AllConsentNames | ManifestInterpolationToken>;
27
- export interface LoadScriptStep {
28
- type: 'loadScript';
29
- src: string;
30
- async?: boolean;
31
- defer?: boolean;
32
- attributes?: Record<string, string>;
33
- }
34
- export interface SetGlobalStep {
35
- type: 'setGlobal';
36
- /** Global variable name (e.g. 'dataLayer') */
37
- name: string;
38
- /** Value to assign. Arrays and objects are recursively cloned on execution. */
39
- value: unknown;
40
- /**
41
- * Only set the global if it's not already defined.
42
- * Mirrors the common `window.x = window.x || value` pattern.
43
- * @default true
44
- */
45
- ifUndefined?: boolean;
46
- }
47
- export interface DefineQueueFunctionStep {
48
- type: 'defineQueueFunction';
49
- /** Global function name (e.g. 'gtag') */
50
- name: string;
51
- /** Global array name that receives queued calls (e.g. 'dataLayer') */
52
- queue: string;
53
- /**
54
- * Only define the function if it is not already present.
55
- * @default true
56
- */
57
- ifUndefined?: boolean;
58
- /**
59
- * Whether queued calls should store the `arguments` object or a copied array.
60
- * @default 'arguments'
61
- */
62
- pushStyle?: 'arguments' | 'array';
63
- }
64
- export interface DefineStubFunctionStep {
65
- type: 'defineStubFunction';
66
- /** Global function name (e.g. 'fbq', 'twq', 'lintrk') */
67
- name: string;
68
- /**
69
- * Queue storage location:
70
- * - `global` pushes into another global array (e.g. `dataLayer`)
71
- * - `property` pushes into a property on the stub function itself (e.g. `fbq.queue`)
72
- */
73
- queue: {
74
- global: string;
75
- property?: never;
76
- } | {
77
- global?: never;
78
- property: string;
79
- };
80
- /**
81
- * If present, calls `stub[dispatchProperty](...args)` when available instead of queueing.
82
- * Mirrors vendor APIs like Meta Pixel's `callMethod`.
83
- */
84
- dispatchProperty?: string;
85
- /**
86
- * How queued values should be stored.
87
- * - `'arguments'` => push the `arguments` object
88
- * - `'array'` => push a copied array of arguments
89
- */
90
- queueFormat?: 'arguments' | 'array';
91
- /** Additional globals that should reference the same stub */
92
- aliases?: string[];
93
- /** Properties on the stub that should reference the stub itself (e.g. `push`) */
94
- selfReferences?: string[];
95
- /** Additional scalar/object properties assigned to the stub */
96
- properties?: Record<string, unknown>;
97
- /** Only define the stub if not already present. */
98
- ifUndefined?: boolean;
99
- }
100
- export interface CallGlobalStep {
101
- type: 'callGlobal';
102
- /** Global object name (e.g. 'posthog', 'fbq') */
103
- global: string;
104
- /** Method to call on the global. If omitted, the global itself is called as a function. */
105
- method?: string;
106
- /** Arguments to pass */
107
- args?: unknown[];
108
- }
109
- export interface PushToQueueStep {
110
- type: 'pushToQueue';
111
- /** Global array name that receives queued values (e.g. 'dataLayer') */
112
- queue: string;
113
- /** Value to push onto the queue */
114
- value: unknown;
115
- }
116
- export interface SetGlobalPathStep {
117
- type: 'setGlobalPath';
118
- /** Path segments under window (e.g. ['databuddy', 'options', 'disabled']) */
119
- path: string[];
120
- /** Value to assign at the target path */
121
- value: unknown;
122
- /** Only assign while the root global is still a snippet queue array. */
123
- ifGlobalIsQueue?: boolean;
124
- }
125
- export interface DefineQueueMethodsStep {
126
- type: 'defineQueueMethods';
127
- /** Global array/object name that owns the queue methods */
128
- target: string;
129
- /** Method names to attach */
130
- methods: string[];
131
- /** Optional queue location. Defaults to the target itself. */
132
- queue?: {
133
- global: string;
134
- property?: never;
135
- } | {
136
- global?: never;
137
- property: string;
138
- };
139
- /**
140
- * Format used for each queued method call.
141
- *
142
- * - `tuple` pushes `[methodName, ...args]`, matching classic array queues.
143
- * - `methodCall` pushes `{ name, args, resolve }` and returns a `Promise`,
144
- * matching SDK loaders that replay named calls and resolve the original
145
- * pre-load promise after the real method runs.
146
- * - `wrappedMethodCall` queues like `methodCall` but returns
147
- * `{ promise }`, matching Amplitude's snippet contract where queued
148
- * proxy calls expose the pending promise on a `promise` property.
149
- * - `voidMethodCall` queues like `methodCall` but returns nothing,
150
- * matching snippet methods the vendor treats as synchronous.
151
- * - `callback` pushes `{ name, fn }`, where `fn` replays the captured call
152
- * against the current global target, matching loaders that own a
153
- * ready-callback queue.
154
- *
155
- * @default 'tuple'
156
- */
157
- queueFormat?: 'tuple' | 'methodCall' | 'wrappedMethodCall' | 'voidMethodCall' | 'callback';
158
- }
159
- export interface DefineQueueClassStep {
160
- type: 'defineQueueClass';
161
- /** Global object that receives the queued helper class. */
162
- target: string;
163
- /** Constructor property name to define on the target object. */
164
- name: string;
165
- /**
166
- * Instance property that stores queued helper method calls.
167
- *
168
- * @default '_q'
169
- */
170
- queueProperty?: string;
171
- /** Helper instance method names to attach to the constructor prototype. */
172
- methods: string[];
173
- }
174
- export type GlobalMethodBehavior = {
175
- name: string;
176
- behavior: 'noop';
177
- } | {
178
- name: string;
179
- behavior: 'return';
180
- value: unknown;
181
- };
182
- export interface DefineGlobalMethodsStep {
183
- type: 'defineGlobalMethods';
184
- /** Global object name to receive the methods */
185
- target: string;
186
- methods: GlobalMethodBehavior[];
187
- /** Only define methods while the target is still a snippet queue array. */
188
- ifGlobalIsQueue?: boolean;
189
- }
190
- export interface ConstructGlobalStep {
191
- type: 'constructGlobal';
192
- /** Global constructor name (e.g. `UET`) */
193
- constructor: string;
194
- /** Global name to assign the constructed instance to */
195
- assignTo: string;
196
- /** Constructor args */
197
- args?: unknown[];
198
- /**
199
- * Copies the current `window[assignTo]` value into the first constructor arg object
200
- * under this property before constructing.
201
- */
202
- copyAssignedValueToArgProperty?: string;
203
- }
204
- export type ManifestStep = LoadScriptStep | SetGlobalStep | DefineQueueFunctionStep | DefineStubFunctionStep | CallGlobalStep | PushToQueueStep | SetGlobalPathStep | DefineQueueMethodsStep | DefineQueueClassStep | DefineGlobalMethodsStep | ConstructGlobalStep;
205
- /**
206
- * Consent signal type determines how consent state is communicated to the vendor.
207
- *
208
- * - `'gtag'` — Google Consent Mode pattern: calls `gtag('consent', 'default'|'update', state)`
209
- * - `'rudderstack'` — RudderStack consent-management pattern: calls
210
- * `rudderanalytics.consent({ consentManagement: { enabled, provider: 'custom',
211
- * allowedConsentIds, deniedConsentIds } })` with the mapping's consent IDs
212
- * partitioned by the current c15t consent state
213
- */
214
- export type ConsentSignalType = 'gtag' | 'rudderstack';
215
- /**
216
- * A declarative definition of a vendor integration.
217
- *
218
- * Manifests are the source definition that the scripts engine compiles into a
219
- * serializable resolved manifest and then converts into a runtime `Script`.
220
- */
221
- export interface VendorManifest extends ManifestContract {
222
- /** Manifest contract identifier. */
223
- kind: typeof VENDOR_MANIFEST_KIND;
224
- /** Manifest schema version. */
225
- schemaVersion: typeof VENDOR_MANIFEST_SCHEMA_VERSION;
226
- /** Unique vendor identifier (used as Script.id) */
227
- vendor: string;
228
- /** Consent category or condition required to load this vendor */
229
- category: ManifestCategoryCondition;
230
- /** Load regardless of consent state (vendor manages its own consent internally) */
231
- alwaysLoad?: boolean | string;
232
- /** Keep script in DOM after consent revocation (vendor has a consent API) */
233
- persistAfterConsentRevoked?: boolean | string;
234
- /**
235
- * Steps that must execute before default consent signaling.
236
- *
237
- * This is primarily used for integrations such as Google tags where a stub
238
- * global must exist before calling the vendor's consent API.
239
- */
240
- bootstrap?: ManifestStep[];
241
- /**
242
- * Steps to execute when installing the vendor.
243
- *
244
- * The resolver extracts the script source from these steps:
245
- * - If a `loadScript` step exists, its `src` becomes `Script.src`
246
- * - All non-`loadScript` steps run as part of `onBeforeLoad`
247
- */
248
- install: ManifestStep[];
249
- /** Steps to execute after the main script loads */
250
- afterLoad?: ManifestStep[];
251
- /** Steps to execute before load when the vendor has consent */
252
- onBeforeLoadGranted?: ManifestStep[];
253
- /** Steps to execute before load when the vendor does not have consent */
254
- onBeforeLoadDenied?: ManifestStep[];
255
- /** Steps to execute after load when the vendor has consent */
256
- onLoadGranted?: ManifestStep[];
257
- /** Steps to execute after load when the vendor does not have consent */
258
- onLoadDenied?: ManifestStep[];
259
- /** Steps to run on any consent state change */
260
- onConsentChange?: ManifestStep[];
261
- /** Steps to run when this vendor's category consent is granted */
262
- onConsentGranted?: ManifestStep[];
263
- /** Steps to run when this vendor's category consent is denied */
264
- onConsentDenied?: ManifestStep[];
265
- /**
266
- * Maps c15t consent categories to vendor-specific consent type names.
267
- *
268
- * Used with `consentSignal` to translate c15t consent state into
269
- * the vendor's consent API format.
270
- *
271
- * @example
272
- * ```ts
273
- * // Google Consent Mode v2 mapping
274
- * consentMapping: {
275
- * marketing: ['ad_storage', 'ad_user_data', 'ad_personalization'],
276
- * measurement: ['analytics_storage'],
277
- * functionality: ['functionality_storage'],
278
- * necessary: ['security_storage'],
279
- * experience: ['personalization_storage'],
280
- * }
281
- * ```
282
- */
283
- consentMapping?: Record<string, string[]>;
284
- /** How to signal consent state to the vendor */
285
- consentSignal?: ConsentSignalType;
286
- /** Target global for consent signaling (defaults based on signal type) */
287
- consentSignalTarget?: string;
288
- }
289
- /**
290
- * Internal transport-ready manifest shape produced by the compile phase.
291
- *
292
- * Contains only serializable data and no runtime callbacks.
293
- */
294
- export interface ResolvedManifest extends ManifestContract {
295
- vendor: string;
296
- category: HasCondition<AllConsentNames>;
297
- alwaysLoad?: boolean;
298
- persistAfterConsentRevoked?: boolean;
299
- bootstrapSteps: ManifestStep[];
300
- setupSteps: ManifestStep[];
301
- loadScript?: LoadScriptStep;
302
- afterLoadSteps: ManifestStep[];
303
- onBeforeLoadGrantedSteps: ManifestStep[];
304
- onBeforeLoadDeniedSteps: ManifestStep[];
305
- onLoadGrantedSteps: ManifestStep[];
306
- onLoadDeniedSteps: ManifestStep[];
307
- onConsentChangeSteps: ManifestStep[];
308
- onConsentGrantedSteps: ManifestStep[];
309
- onConsentDeniedSteps: ManifestStep[];
310
- consentMapping?: Record<string, string[]>;
311
- consentSignal?: ConsentSignalType;
312
- consentSignalTarget?: string;
313
- }
314
- export {};
1
+ /** @deprecated Use @c15t/integrations/types. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/types';
@@ -0,0 +1,2 @@
1
+ /** @deprecated Use @c15t/integrations/umami-analytics. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/umami-analytics';
@@ -1,35 +1,2 @@
1
- /**
2
- * Converts an optional boolean into a string suitable for a script `data-*`
3
- * attribute.
4
- *
5
- * @param value - Optional boolean value from a vendor option.
6
- * @returns `'true'` or `'false'` when a boolean is provided, otherwise
7
- * `undefined` so the manifest compiler can omit the attribute.
8
- *
9
- * @example
10
- * ```ts
11
- * booleanDataAttribute(true); // 'true'
12
- * booleanDataAttribute(false); // 'false'
13
- * booleanDataAttribute(undefined); // undefined
14
- * ```
15
- */
16
- export declare const booleanDataAttribute: (value: boolean | undefined) => string | undefined;
17
- /**
18
- * Converts a string or string list into a script `data-*` attribute value.
19
- *
20
- * Arrays are JSON-serialized so values containing commas can be round-tripped
21
- * with `JSON.parse` by consumers that read the attribute.
22
- *
23
- * @param value - Optional string value or string list from a vendor option.
24
- * @returns The original string, a JSON-serialized array, or `undefined` so the
25
- * manifest compiler can omit the attribute.
26
- *
27
- * @example
28
- * ```ts
29
- * listDataAttribute('example.com'); // 'example.com'
30
- * listDataAttribute(['a.com', 'b.com']); // '["a.com","b.com"]'
31
- * listDataAttribute([]); // undefined
32
- * listDataAttribute(undefined); // undefined
33
- * ```
34
- */
35
- export declare const listDataAttribute: (value: string[] | string | undefined) => string | undefined;
1
+ /** @deprecated Use @c15t/integrations/vendors/_shared/attributes. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/_shared/attributes';
@@ -1,47 +1,2 @@
1
- /**
2
- * Default c15t consent category mapping for Google Consent Mode v2.
3
- *
4
- * @remarks
5
- * Shared by direct gtag.js and Google Tag Manager integrations so both emit the
6
- * same Google storage consent defaults unless a caller provides an override.
7
- *
8
- * @example
9
- * ```ts
10
- * const manifest = {
11
- * consentMapping: GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING,
12
- * };
13
- * ```
14
- */
15
- export declare const GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING: Record<string, string[]>;
16
- /**
17
- * Applies an optional Google consent mapping override to a manifest.
18
- *
19
- * @param manifest - Vendor manifest that already contains the default consent
20
- * mapping.
21
- * @param consentMapping - Optional caller-provided mapping from c15t consent
22
- * categories to Google consent types.
23
- * @returns The original manifest when no override is provided, or a shallow
24
- * copy with the override mapping when one is provided.
25
- *
26
- * @example
27
- * ```ts
28
- * const customMapping: Record<string, string[]> = {
29
- * marketing: ['ad_storage'],
30
- * };
31
- * const mapped = withOptionalConsentMapping<TManifest>(
32
- * manifest,
33
- * customMapping
34
- * );
35
- * ```
36
- *
37
- * @example
38
- * ```ts
39
- * const unchanged = withOptionalConsentMapping<TManifest>(
40
- * manifest,
41
- * undefined
42
- * );
43
- * ```
44
- */
45
- export declare const withOptionalConsentMapping: <TManifest extends {
46
- consentMapping?: Record<string, string[]>;
47
- }>(manifest: TManifest, consentMapping: Record<string, string[]> | undefined) => TManifest;
1
+ /** @deprecated Use @c15t/integrations/vendors/_shared/google-consent. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/_shared/google-consent';
@@ -1,30 +1,2 @@
1
- import type { VendorManifest } from '../../types.js';
2
- /**
3
- * Optional tracking call inserted between the vendor init call and script load.
4
- */
5
- interface QueuePixelInstallStep {
6
- /** Arguments passed to the vendor queue function. */
7
- args: unknown[];
8
- }
9
- /**
10
- * Options for building the common pixel install sequence.
11
- */
12
- export interface BuildQueuePixelInstallOptions {
13
- /** Global queue function to call, for example `rdt` or `snaptr`. */
14
- global: string;
15
- /** Arguments for the required initialization call. */
16
- initArgs: unknown[];
17
- /** Optional tracking command queued immediately after initialization. */
18
- trackStep?: QueuePixelInstallStep;
19
- /** Manifest interpolation token used for the final loader script URL. */
20
- scriptPlaceholder?: string;
21
- }
22
- /**
23
- * Builds the common queue-pixel install sequence used by advertising pixels.
24
- *
25
- * @param options - Queue pixel install options.
26
- * @returns Manifest install steps containing the required init call, an
27
- * optional tracking call, and an async `loadScript` step.
28
- */
29
- export declare const buildQueuePixelInstall: ({ global, initArgs, trackStep, scriptPlaceholder, }: BuildQueuePixelInstallOptions) => VendorManifest['install'];
30
- export {};
1
+ /** @deprecated Use @c15t/integrations/vendors/_shared/install-builders. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/_shared/install-builders';
@@ -0,0 +1,2 @@
1
+ /** @deprecated Use @c15t/integrations/vendors/_shared/required-id. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/_shared/required-id';
@@ -1,75 +1,2 @@
1
- /**
2
- * Trims an optional string and treats empty or whitespace-only values as
3
- * missing.
4
- *
5
- * @param value - Optional string value, usually a user-provided override.
6
- * @returns The trimmed string when it contains non-whitespace characters,
7
- * otherwise `undefined`.
8
- *
9
- * @example
10
- * ```ts
11
- * trimToUndefined(', https://cdn.example.com '); // 'https://cdn.example.com'
12
- * trimToUndefined(' '); // undefined
13
- * trimToUndefined(undefined); // undefined
14
- * ```
15
- */
16
- export declare const trimToUndefined: (value: string | undefined) => string | undefined;
17
- /**
18
- * Resolves a script URL from an optional override and a required fallback.
19
- *
20
- * @param override - Explicit script URL supplied by the integration caller.
21
- * @param fallback - Default vendor script URL.
22
- * @returns `override` when it is defined, otherwise `fallback`.
23
- *
24
- * @remarks
25
- * This helper intentionally does not trim or validate the override. Use
26
- * `trimToUndefined` before calling this helper when blank string overrides
27
- * should fall back to the vendor default.
28
- *
29
- * @example
30
- * ```ts
31
- * resolveScriptUrl(undefined, 'https://cdn.example.com/default.js');
32
- * // 'https://cdn.example.com/default.js'
33
- * ```
34
- *
35
- * @example
36
- * ```ts
37
- * resolveScriptUrl(
38
- * 'https://custom.com/script.js',
39
- * 'https://cdn.example.com/default.js'
40
- * );
41
- * // 'https://custom.com/script.js'
42
- * ```
43
- */
44
- export declare const resolveScriptUrl: (override: string | undefined, fallback: string) => string;
45
- /**
46
- * Removes leading slash characters without using a regular expression.
47
- *
48
- * This helper is used on caller-controlled URL fragments, so it intentionally
49
- * stays linear even for very long repeated slash input.
50
- */
51
- export declare const stripLeadingSlashes: (value: string) => string;
52
- /**
53
- * Removes trailing slash characters without using a regular expression.
54
- *
55
- * This helper is used on caller-controlled URL fragments, so it intentionally
56
- * stays linear even for very long repeated slash input.
57
- */
58
- export declare const stripTrailingSlashes: (value: string) => string;
59
- /**
60
- * Joins a base URL and path with exactly one slash between them.
61
- *
62
- * @param base - Base URL or origin. Trailing slashes are removed before joining.
63
- * @param path - Path segment. Leading slashes are removed before joining.
64
- * @returns A slash-joined URL string.
65
- *
66
- * @example
67
- * ```ts
68
- * joinUrlPath('https://example.com///', '///script.js');
69
- * // 'https://example.com/script.js'
70
- *
71
- * joinUrlPath('https://example.com', 'script.js');
72
- * // 'https://example.com/script.js'
73
- * ```
74
- */
75
- export declare const joinUrlPath: (base: string, path: string) => string;
1
+ /** @deprecated Use @c15t/integrations/vendors/_shared/script-url. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/_shared/script-url';
@@ -1,92 +1,2 @@
1
- import type { Script } from '@c15t/core';
2
- export interface LinkedInInsightsConversionEvent {
3
- conversion_id: string | number;
4
- [key: string]: unknown;
5
- }
6
- interface LinkedInInsightsFunction {
7
- (command: 'track', event: LinkedInInsightsConversionEvent): void;
8
- (command: string, ...args: unknown[]): void;
9
- }
10
- declare global {
11
- interface Window {
12
- lintrk: LinkedInInsightsFunction & {
13
- q?: unknown[][];
14
- };
15
- _linkedin_partner_id?: string;
16
- _linkedin_data_partner_ids?: string[];
17
- ORIBILI?: {
18
- _DEBUG?: {
19
- disableScript?: () => void;
20
- };
21
- };
22
- }
23
- }
24
- /**
25
- * LinkedIn Insight Tag vendor manifest.
26
- *
27
- * Sets up the LinkedIn partner ID globals and loads the Insight Tag script
28
- * via structured startup steps.
29
- */
30
- export declare const linkedinInsightsManifest: {
31
- readonly kind: "c15t.vendor-manifest";
32
- readonly schemaVersion: 1;
33
- readonly category: 'marketing';
34
- readonly install: [{
35
- readonly ifUndefined: false;
36
- readonly name: '_linkedin_partner_id';
37
- readonly type: 'setGlobal';
38
- readonly value: '{{id}}';
39
- }, {
40
- readonly ifUndefined: true;
41
- readonly name: '_linkedin_data_partner_ids';
42
- readonly type: 'setGlobal';
43
- readonly value: readonly [];
44
- }, {
45
- readonly queue: '_linkedin_data_partner_ids';
46
- readonly type: 'pushToQueue';
47
- readonly value: '{{id}}';
48
- }, {
49
- readonly ifUndefined: true;
50
- readonly name: 'lintrk';
51
- readonly queue: {
52
- readonly property: 'q';
53
- };
54
- readonly queueFormat: 'array';
55
- readonly type: 'defineStubFunction';
56
- }, {
57
- readonly async: true;
58
- readonly src: '{{scriptSrc}}';
59
- readonly type: 'loadScript';
60
- }];
61
- readonly vendor: 'linkedin-insights';
62
- };
63
- export interface LinkedInInsightsOptions {
64
- /**
65
- * Your LinkedIn Insight Tag partner ID.
66
- *
67
- * LinkedIn shows this in Campaign Manager under Data -> Signals manager ->
68
- * Insight Tag.
69
- *
70
- * @example `123456789012345`
71
- */
72
- id: string;
73
- /** LinkedIn Insight Tag loader URL. */
74
- scriptSrc?: string;
75
- }
76
- /**
77
- * LinkedIn Insight Tag script.
78
- *
79
- * @param options - The options for the LinkedIn Insight Tag script.
80
- * @returns The LinkedIn Insight Tag script configuration.
81
- *
82
- * @example
83
- * ```ts
84
- * const linkedinInsightsScript = linkedinInsights({
85
- * id: '123456789012345',
86
- * });
87
- * ```
88
- *
89
- * @see {@link https://www.linkedin.com/help/lms/answer/a418880} Add the LinkedIn Insight Tag to your website
90
- */
91
- export declare const linkedinInsights: ({ id, scriptSrc, }: LinkedInInsightsOptions) => Script;
92
- export {};
1
+ /** @deprecated Use @c15t/integrations/vendors/ads-and-pixels/linkedin-insights. Compatibility ends in v4. */
2
+ export * from '@c15t/integrations/vendors/ads-and-pixels/linkedin-insights';