@c15t/scripts 2.2.0 → 3.0.0-alpha.0

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 (197) hide show
  1. package/AGENTS.md +74 -48
  2. package/README.md +3 -3
  3. package/dist/e2e-test-utils.js +60 -24
  4. package/dist/engine/compile.js +45 -45
  5. package/dist/engine/runtime.js +119 -119
  6. package/dist/registry.js +186 -176
  7. package/dist/resolve.js +12 -12
  8. package/dist/vendors/_shared/attributes.js +5 -5
  9. package/dist/vendors/_shared/google-consent.js +10 -10
  10. package/dist/vendors/_shared/install-builders.js +9 -9
  11. package/dist/vendors/_shared/script-url.js +12 -12
  12. package/dist/vendors/ads-and-pixels/linkedin-insights.js +16 -16
  13. package/dist/vendors/ads-and-pixels/meta-pixel.js +82 -82
  14. package/dist/vendors/ads-and-pixels/microsoft-uet.js +57 -57
  15. package/dist/vendors/ads-and-pixels/openai-pixel.js +88 -0
  16. package/dist/vendors/ads-and-pixels/reddit-pixel.js +39 -39
  17. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +25 -25
  18. package/dist/vendors/ads-and-pixels/tiktok-pixel.js +31 -31
  19. package/dist/vendors/ads-and-pixels/x-pixel.js +17 -17
  20. package/dist/vendors/analytics/adobe-analytics.js +17 -17
  21. package/dist/vendors/analytics/ahrefs-analytics.js +8 -8
  22. package/dist/vendors/analytics/amplitude.js +39 -39
  23. package/dist/vendors/analytics/clearbit.js +11 -11
  24. package/dist/vendors/analytics/cloudflare-web-analytics.js +13 -13
  25. package/dist/vendors/analytics/databuddy.js +45 -45
  26. package/dist/vendors/analytics/fathom-analytics.js +15 -15
  27. package/dist/vendors/analytics/google-tag.js +23 -23
  28. package/dist/vendors/analytics/heap.js +37 -37
  29. package/dist/vendors/analytics/hightouch.js +30 -30
  30. package/dist/vendors/analytics/hotjar.js +14 -14
  31. package/dist/vendors/analytics/logrocket.js +24 -24
  32. package/dist/vendors/analytics/matomo-analytics.js +51 -51
  33. package/dist/vendors/analytics/microsoft-clarity.js +31 -31
  34. package/dist/vendors/analytics/mixpanel-analytics.js +31 -31
  35. package/dist/vendors/analytics/pirsch.js +27 -27
  36. package/dist/vendors/analytics/plausible-analytics.js +24 -24
  37. package/dist/vendors/analytics/posthog.js +84 -79
  38. package/dist/vendors/analytics/promptwatch.js +8 -8
  39. package/dist/vendors/analytics/rudderstack.js +50 -50
  40. package/dist/vendors/analytics/rybbit-analytics.js +30 -30
  41. package/dist/vendors/analytics/segment.js +16 -16
  42. package/dist/vendors/analytics/umami-analytics.js +16 -16
  43. package/dist/vendors/analytics/vercel-analytics.js +22 -22
  44. package/dist/vendors/functional/crisp.js +49 -51
  45. package/dist/vendors/functional/intercom.js +18 -18
  46. package/dist/vendors/tag-managers/google-tag-manager.js +20 -20
  47. package/dist-types/__tests__/helpers.d.ts +10 -10
  48. package/dist-types/engine/compile.d.ts +2 -2
  49. package/dist-types/engine/runtime.d.ts +3 -3
  50. package/dist-types/registry.d.ts +182 -173
  51. package/dist-types/resolve.d.ts +2 -2
  52. package/dist-types/types.d.ts +2 -2
  53. package/dist-types/vendors/_shared/attributes.d.ts +2 -2
  54. package/dist-types/vendors/_shared/google-consent.d.ts +2 -2
  55. package/dist-types/vendors/_shared/install-builders.d.ts +1 -1
  56. package/dist-types/vendors/_shared/script-url.d.ts +6 -6
  57. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +14 -14
  58. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +27 -27
  59. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +40 -40
  60. package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +211 -0
  61. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +28 -29
  62. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +23 -23
  63. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +22 -22
  64. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +15 -15
  65. package/dist-types/vendors/analytics/adobe-analytics.d.ts +3 -3
  66. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +5 -5
  67. package/dist-types/vendors/analytics/amplitude.d.ts +24 -24
  68. package/dist-types/vendors/analytics/clearbit.d.ts +5 -5
  69. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +6 -6
  70. package/dist-types/vendors/analytics/databuddy.d.ts +34 -31
  71. package/dist-types/vendors/analytics/fathom-analytics.d.ts +8 -8
  72. package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
  73. package/dist-types/vendors/analytics/heap.d.ts +17 -17
  74. package/dist-types/vendors/analytics/hightouch.d.ts +15 -15
  75. package/dist-types/vendors/analytics/hotjar.d.ts +9 -9
  76. package/dist-types/vendors/analytics/logrocket.d.ts +11 -11
  77. package/dist-types/vendors/analytics/matomo-analytics.d.ts +3 -3
  78. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +12 -13
  79. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +20 -20
  80. package/dist-types/vendors/analytics/pirsch.d.ts +10 -10
  81. package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
  82. package/dist-types/vendors/analytics/posthog.d.ts +35 -32
  83. package/dist-types/vendors/analytics/promptwatch.d.ts +5 -5
  84. package/dist-types/vendors/analytics/rudderstack.d.ts +16 -16
  85. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +15 -15
  86. package/dist-types/vendors/analytics/segment.d.ts +11 -11
  87. package/dist-types/vendors/analytics/umami-analytics.d.ts +9 -9
  88. package/dist-types/vendors/analytics/vercel-analytics.d.ts +13 -13
  89. package/dist-types/vendors/functional/crisp.d.ts +9 -9
  90. package/dist-types/vendors/functional/intercom.d.ts +12 -12
  91. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +16 -16
  92. package/docs/README.md +74 -48
  93. package/docs/assets/v3/brand-bar.png +0 -0
  94. package/docs/assets/v3/brand-card.png +0 -0
  95. package/docs/assets/v3/choice-wall.png +0 -0
  96. package/docs/assets/v3/mobile-card.png +0 -0
  97. package/docs/assets/v3/preferences.png +0 -0
  98. package/docs/customization/overview.md +45 -0
  99. package/docs/customization/recipes.md +79 -0
  100. package/docs/customization/slots.md +55 -0
  101. package/docs/customization/tokens.md +76 -0
  102. package/docs/customization/translations.md +49 -0
  103. package/docs/frameworks/javascript/script-loader.md +30 -339
  104. package/docs/frameworks/next/script-loader.md +134 -467
  105. package/docs/frameworks/react/script-loader.md +35 -535
  106. package/docs/guides/consent-state.md +60 -0
  107. package/docs/guides/data-fetching.md +163 -0
  108. package/docs/guides/deployment-modes.md +63 -0
  109. package/docs/guides/troubleshooting.md +68 -0
  110. package/docs/guides/verify-consent.md +62 -0
  111. package/docs/integrations/adobe-analytics.md +239 -105
  112. package/docs/integrations/ahrefs-analytics.md +238 -104
  113. package/docs/integrations/amplitude.md +219 -157
  114. package/docs/integrations/building-integrations.md +32 -224
  115. package/docs/integrations/clearbit.md +247 -86
  116. package/docs/integrations/cloudflare-web-analytics.md +250 -84
  117. package/docs/integrations/crisp.md +251 -97
  118. package/docs/integrations/databuddy.md +259 -153
  119. package/docs/integrations/fathom-analytics.md +239 -96
  120. package/docs/integrations/google-maps.md +328 -207
  121. package/docs/integrations/google-tag-manager.md +248 -96
  122. package/docs/integrations/google-tag.md +261 -90
  123. package/docs/integrations/heap.md +222 -149
  124. package/docs/integrations/hightouch.md +225 -131
  125. package/docs/integrations/hotjar.md +239 -90
  126. package/docs/integrations/intercom.md +239 -98
  127. package/docs/integrations/linkedin-insights.md +243 -113
  128. package/docs/integrations/logrocket.md +241 -123
  129. package/docs/integrations/matomo-analytics.md +256 -111
  130. package/docs/integrations/meta-pixel.md +197 -324
  131. package/docs/integrations/microsoft-clarity.md +233 -114
  132. package/docs/integrations/microsoft-uet.md +245 -110
  133. package/docs/integrations/mixpanel-analytics.md +252 -87
  134. package/docs/integrations/openai-pixel.md +441 -0
  135. package/docs/integrations/overview.md +95 -133
  136. package/docs/integrations/pirsch.md +249 -96
  137. package/docs/integrations/plausible-analytics.md +241 -100
  138. package/docs/integrations/posthog.md +353 -214
  139. package/docs/integrations/promptwatch.md +251 -81
  140. package/docs/integrations/reddit-pixel.md +226 -173
  141. package/docs/integrations/rudderstack.md +244 -187
  142. package/docs/integrations/rybbit-analytics.md +244 -91
  143. package/docs/integrations/segment.md +238 -92
  144. package/docs/integrations/snapchat-pixel.md +240 -110
  145. package/docs/integrations/tiktok-pixel.md +249 -81
  146. package/docs/integrations/umami-analytics.md +242 -95
  147. package/docs/integrations/vercel-analytics.md +242 -90
  148. package/docs/integrations/x-pixel.md +238 -104
  149. package/docs/integrations/youtube.md +354 -142
  150. package/docs/upgrade-v3.md +334 -0
  151. package/package.json +85 -78
  152. package/readme.json +2 -2
  153. package/dist/e2e-test-utils.cjs +0 -166
  154. package/dist/engine/compile.cjs +0 -130
  155. package/dist/engine/runtime.cjs +0 -475
  156. package/dist/registry.cjs +0 -423
  157. package/dist/resolve.cjs +0 -71
  158. package/dist/types.cjs +0 -69
  159. package/dist/vendors/_shared/attributes.cjs +0 -55
  160. package/dist/vendors/_shared/google-consent.cjs +0 -69
  161. package/dist/vendors/_shared/install-builders.cjs +0 -59
  162. package/dist/vendors/_shared/script-url.cjs +0 -78
  163. package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +0 -89
  164. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +0 -206
  165. package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +0 -151
  166. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +0 -151
  167. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +0 -131
  168. package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +0 -130
  169. package/dist/vendors/ads-and-pixels/x-pixel.cjs +0 -92
  170. package/dist/vendors/analytics/adobe-analytics.cjs +0 -90
  171. package/dist/vendors/analytics/ahrefs-analytics.cjs +0 -68
  172. package/dist/vendors/analytics/amplitude.cjs +0 -193
  173. package/dist/vendors/analytics/clearbit.cjs +0 -69
  174. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +0 -73
  175. package/dist/vendors/analytics/databuddy.cjs +0 -144
  176. package/dist/vendors/analytics/fathom-analytics.cjs +0 -76
  177. package/dist/vendors/analytics/google-tag.cjs +0 -107
  178. package/dist/vendors/analytics/heap.cjs +0 -181
  179. package/dist/vendors/analytics/hightouch.cjs +0 -153
  180. package/dist/vendors/analytics/hotjar.cjs +0 -85
  181. package/dist/vendors/analytics/logrocket.cjs +0 -99
  182. package/dist/vendors/analytics/matomo-analytics.cjs +0 -232
  183. package/dist/vendors/analytics/microsoft-clarity.cjs +0 -138
  184. package/dist/vendors/analytics/mixpanel-analytics.cjs +0 -134
  185. package/dist/vendors/analytics/pirsch.cjs +0 -108
  186. package/dist/vendors/analytics/plausible-analytics.cjs +0 -122
  187. package/dist/vendors/analytics/posthog.cjs +0 -236
  188. package/dist/vendors/analytics/promptwatch.cjs +0 -70
  189. package/dist/vendors/analytics/rudderstack.cjs +0 -227
  190. package/dist/vendors/analytics/rybbit-analytics.cjs +0 -104
  191. package/dist/vendors/analytics/segment.cjs +0 -97
  192. package/dist/vendors/analytics/umami-analytics.cjs +0 -80
  193. package/dist/vendors/analytics/vercel-analytics.cjs +0 -94
  194. package/dist/vendors/functional/crisp.cjs +0 -143
  195. package/dist/vendors/functional/intercom.cjs +0 -89
  196. package/dist/vendors/tag-managers/google-tag-manager.cjs +0 -100
  197. package/docs/shared/react/guides/script-loader.md +0 -311
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  export type SnapchatPixelEventName = 'PAGE_VIEW' | 'VIEW_CONTENT' | 'ADD_CART' | 'PURCHASE' | 'SIGN_UP' | 'SAVE' | 'START_CHECKOUT' | 'APP_OPEN' | 'ADD_BILLING' | 'SEARCH' | 'SUBSCRIBE' | 'AD_CLICK' | 'AD_VIEW' | 'COMPLETE_TUTORIAL' | 'LEVEL_COMPLETE' | 'INVITE' | 'LOGIN' | 'SHARE' | 'RESERVE' | 'ACHIEVEMENT_UNLOCKED' | 'ADD_TO_WISHLIST' | 'SPENT_CREDITS' | 'RATE' | 'START_TRIAL' | 'LIST_VIEW';
3
3
  export interface SnapchatPixelEventProperties {
4
4
  /** Total monetary value for commerce events such as `PURCHASE`. */
@@ -38,11 +38,11 @@ export interface SnapchatPixelEventProperties {
38
38
  event_tag?: string;
39
39
  [key: string]: unknown;
40
40
  }
41
- type SnapchatPixelFunction = {
42
- (command: 'track', eventName: SnapchatPixelEventName | (string & {}), properties?: SnapchatPixelEventProperties): void;
41
+ interface SnapchatPixelFunction {
42
+ (command: 'track', eventName: SnapchatPixelEventName | (string & Record<never, never>), properties?: SnapchatPixelEventProperties): void;
43
43
  (command: 'init', pixelId: string, config?: Record<string, unknown>): void;
44
44
  (command: string, ...args: unknown[]): void;
45
- };
45
+ }
46
46
  declare global {
47
47
  interface Window {
48
48
  snaptr?: SnapchatPixelFunction & {
@@ -64,37 +64,37 @@ declare global {
64
64
  export declare const snapchatPixelManifest: {
65
65
  readonly kind: "c15t.vendor-manifest";
66
66
  readonly schemaVersion: 1;
67
- readonly vendor: 'snapchat-pixel';
68
- readonly category: 'marketing';
69
67
  readonly bootstrap: [{
70
- readonly type: 'defineStubFunction';
68
+ readonly aliases: ["_snaptr"];
69
+ readonly dispatchProperty: 'handleRequest';
70
+ readonly ifUndefined: true;
71
71
  readonly name: 'snaptr';
72
+ readonly properties: {
73
+ readonly loaded: true;
74
+ readonly version: '1.0';
75
+ };
72
76
  readonly queue: {
73
77
  readonly property: 'queue';
74
78
  };
75
- readonly dispatchProperty: 'handleRequest';
76
79
  readonly queueFormat: 'array';
77
- readonly aliases: ["_snaptr"];
78
80
  readonly selfReferences: ["push"];
79
- readonly properties: {
80
- readonly loaded: true;
81
- readonly version: '1.0';
82
- };
83
- readonly ifUndefined: true;
81
+ readonly type: 'defineStubFunction';
84
82
  }];
83
+ readonly category: 'marketing';
85
84
  readonly install: [{
86
- readonly type: 'callGlobal';
87
- readonly global: 'snaptr';
88
85
  readonly args: ["init", "{{pixelId}}"];
89
- }, {
90
- readonly type: 'callGlobal';
91
86
  readonly global: 'snaptr';
87
+ readonly type: 'callGlobal';
88
+ }, {
92
89
  readonly args: ["track", "PAGE_VIEW"];
90
+ readonly global: 'snaptr';
91
+ readonly type: 'callGlobal';
93
92
  }, {
94
- readonly type: 'loadScript';
95
- readonly src: '{{scriptUrl}}';
96
93
  readonly async: true;
94
+ readonly src: '{{scriptUrl}}';
95
+ readonly type: 'loadScript';
97
96
  }];
97
+ readonly vendor: 'snapchat-pixel';
98
98
  };
99
99
  export interface SnapchatPixelOptions {
100
100
  /**
@@ -128,7 +128,7 @@ export interface SnapchatPixelOptions {
128
128
  * @returns A resolved c15t `Script` configuration that defines the Snapchat
129
129
  * queue stub, runs `init` (and optionally `PAGE_VIEW`), and then loads the
130
130
  * Snapchat SDK script URL.
131
- * @throws `resolveManifest` may throw when required placeholders cannot be
131
+ * @throws {Error} `resolveManifest` may throw when required placeholders cannot be
132
132
  * resolved (for example, when `pixelId` is missing/empty) or when provided
133
133
  * manifest values are invalid for interpolation.
134
134
  *
@@ -149,7 +149,7 @@ export interface SnapchatPixelOptions {
149
149
  * });
150
150
  * ```
151
151
  */
152
- export declare function snapchatPixel({ pixelId, initOptions, trackPageView, scriptUrl, }: SnapchatPixelOptions): Script;
152
+ export declare const snapchatPixel: ({ pixelId, initOptions, trackPageView, scriptUrl, }: SnapchatPixelOptions) => Script;
153
153
  /**
154
154
  * Tracks a Snapchat Pixel event.
155
155
  *
@@ -167,5 +167,5 @@ export declare function snapchatPixel({ pixelId, initOptions, trackPageView, scr
167
167
  * });
168
168
  * ```
169
169
  */
170
- export declare const snapchatPixelEvent: (eventName: SnapchatPixelEventName | (string & {}), properties?: SnapchatPixelEventProperties) => void;
170
+ export declare const snapchatPixelEvent: (eventName: SnapchatPixelEventName | (string & Record<never, never>), properties?: SnapchatPixelEventProperties) => void;
171
171
  export {};
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  interface TikTokPixelFunction {
3
3
  grantConsent: () => void;
4
4
  revokeConsent: () => void;
@@ -31,51 +31,51 @@ declare global {
31
31
  export declare const tiktokPixelManifest: {
32
32
  readonly kind: "c15t.vendor-manifest";
33
33
  readonly schemaVersion: 1;
34
- readonly vendor: 'tiktok-pixel';
35
- readonly category: 'marketing';
36
- readonly persistAfterConsentRevoked: true;
34
+ readonly afterLoad: [{
35
+ readonly global: 'ttq';
36
+ readonly method: 'grantConsent';
37
+ readonly type: 'callGlobal';
38
+ }];
37
39
  readonly bootstrap: [{
38
- readonly type: 'setGlobal';
39
40
  readonly name: 'TiktokAnalyticsObject';
41
+ readonly type: 'setGlobal';
40
42
  readonly value: 'ttq';
41
43
  }, {
42
- readonly type: 'setGlobal';
44
+ readonly ifUndefined: true;
43
45
  readonly name: 'ttq';
46
+ readonly type: 'setGlobal';
44
47
  readonly value: readonly [];
45
- readonly ifUndefined: true;
46
48
  }, {
47
- readonly type: 'defineQueueMethods';
48
- readonly target: 'ttq';
49
49
  readonly methods: ["page", "track", "identify", "instances", "debug", "on", "off", "once", "ready", "alias", "group", "enableCookie", "disableCookie", "holdConsent", "revokeConsent", "grantConsent"];
50
+ readonly target: 'ttq';
51
+ readonly type: 'defineQueueMethods';
50
52
  }];
53
+ readonly category: 'marketing';
51
54
  readonly install: [{
52
- readonly type: 'callGlobal';
53
55
  readonly global: 'ttq';
54
56
  readonly method: 'grantConsent';
55
- }, {
56
57
  readonly type: 'callGlobal';
58
+ }, {
57
59
  readonly global: 'ttq';
58
60
  readonly method: 'page';
61
+ readonly type: 'callGlobal';
59
62
  }, {
60
- readonly type: 'loadScript';
61
- readonly src: '{{scriptSrc}}?sdkid={{pixelId}}&lib=ttq';
62
63
  readonly async: true;
64
+ readonly src: '{{scriptSrc}}?sdkid={{pixelId}}&lib=ttq';
65
+ readonly type: 'loadScript';
63
66
  }];
64
- readonly afterLoad: [{
65
- readonly type: 'callGlobal';
67
+ readonly onConsentDenied: [{
66
68
  readonly global: 'ttq';
67
- readonly method: 'grantConsent';
69
+ readonly method: 'revokeConsent';
70
+ readonly type: 'callGlobal';
68
71
  }];
69
72
  readonly onConsentGranted: [{
70
- readonly type: 'callGlobal';
71
73
  readonly global: 'ttq';
72
74
  readonly method: 'grantConsent';
73
- }];
74
- readonly onConsentDenied: [{
75
75
  readonly type: 'callGlobal';
76
- readonly global: 'ttq';
77
- readonly method: 'revokeConsent';
78
76
  }];
77
+ readonly persistAfterConsentRevoked: true;
78
+ readonly vendor: 'tiktok-pixel';
79
79
  };
80
80
  export interface TikTokPixelOptions {
81
81
  /**
@@ -102,5 +102,5 @@ export interface TikTokPixelOptions {
102
102
  *
103
103
  * @see {@link https://ads.tiktok.com/help/article/tiktok-pixel} TikTok Pixel documentation
104
104
  */
105
- export declare function tiktokPixel({ pixelId, scriptSrc, }: TikTokPixelOptions): Script;
105
+ export declare const tiktokPixel: ({ pixelId, scriptSrc, }: TikTokPixelOptions) => Script;
106
106
  export {};
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  export interface XPixelContent {
3
3
  /**
4
4
  * Type of the content
@@ -107,29 +107,29 @@ declare global {
107
107
  export declare const xPixelManifest: {
108
108
  readonly kind: "c15t.vendor-manifest";
109
109
  readonly schemaVersion: 1;
110
- readonly vendor: 'x-pixel';
111
- readonly category: 'marketing';
112
110
  readonly bootstrap: [{
113
- readonly type: 'defineStubFunction';
114
- readonly name: 'twq';
115
- readonly queue: {
116
- readonly property: 'queue';
117
- };
118
111
  readonly dispatchProperty: 'exe';
112
+ readonly ifUndefined: true;
113
+ readonly name: 'twq';
119
114
  readonly properties: {
120
115
  readonly version: '1.1';
121
116
  };
122
- readonly ifUndefined: true;
117
+ readonly queue: {
118
+ readonly property: 'queue';
119
+ };
120
+ readonly type: 'defineStubFunction';
123
121
  }];
122
+ readonly category: 'marketing';
124
123
  readonly install: [{
125
- readonly type: 'callGlobal';
126
- readonly global: 'twq';
127
124
  readonly args: ["config", "{{pixelId}}"];
125
+ readonly global: 'twq';
126
+ readonly type: 'callGlobal';
128
127
  }, {
129
- readonly type: 'loadScript';
130
- readonly src: '{{scriptSrc}}';
131
128
  readonly async: true;
129
+ readonly src: '{{scriptSrc}}';
130
+ readonly type: 'loadScript';
132
131
  }];
132
+ readonly vendor: 'x-pixel';
133
133
  };
134
134
  export interface XPixelOptions {
135
135
  /**
@@ -157,13 +157,13 @@ export interface XPixelOptions {
157
157
  *
158
158
  * @see {@link https://business.x.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites} X conversion tracking documentation
159
159
  */
160
- export declare function xPixel({ pixelId, scriptSrc }: XPixelOptions): Script;
160
+ export declare const xPixel: ({ pixelId, scriptSrc, }: XPixelOptions) => Script;
161
161
  /**
162
162
  * @param eventId - The event ID to track
163
163
  * @example 'tw-xxxx-xxxx'
164
164
  * @param metadata - Optional metadata to track
165
165
  *
166
- * @usage
166
+ * @example
167
167
  * ```ts
168
168
  * xPixelEvent('tw-xxxx-xxxx', {
169
169
  * value: 200.00,
@@ -1,5 +1,5 @@
1
- import type { Script } from 'c15t';
2
- import { type VendorManifest } from '../../types';
1
+ import type { Script } from '@c15t/core';
2
+ import type { VendorManifest } from '../../types';
3
3
  declare global {
4
4
  interface Window {
5
5
  adobeDataLayer?: unknown[];
@@ -72,4 +72,4 @@ export interface AdobeAnalyticsOptions {
72
72
  * });
73
73
  * ```
74
74
  */
75
- export declare function adobeAnalytics(options: AdobeAnalyticsOptions): Script;
75
+ export declare const adobeAnalytics: (options: AdobeAnalyticsOptions) => Script;
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  declare global {
3
3
  interface Window {
4
4
  AhrefsAnalytics?: {
@@ -19,16 +19,16 @@ declare global {
19
19
  export declare const ahrefsAnalyticsManifest: {
20
20
  readonly kind: "c15t.vendor-manifest";
21
21
  readonly schemaVersion: 1;
22
- readonly vendor: 'ahrefs-analytics';
23
22
  readonly category: 'measurement';
24
23
  readonly install: [{
25
- readonly type: 'loadScript';
26
- readonly src: '{{scriptUrl}}';
27
24
  readonly async: true;
28
25
  readonly attributes: {
29
26
  readonly 'data-key': '{{key}}';
30
27
  };
28
+ readonly src: '{{scriptUrl}}';
29
+ readonly type: 'loadScript';
31
30
  }];
31
+ readonly vendor: 'ahrefs-analytics';
32
32
  };
33
33
  export interface AhrefsAnalyticsOptions {
34
34
  /**
@@ -59,4 +59,4 @@ export interface AhrefsAnalyticsOptions {
59
59
  * ahrefsAnalytics({ key: 'YOUR_PROJECT_KEY' });
60
60
  * ```
61
61
  */
62
- export declare function ahrefsAnalytics(options: AhrefsAnalyticsOptions): Script;
62
+ export declare const ahrefsAnalytics: (options: AhrefsAnalyticsOptions) => Script;
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  /**
3
3
  * Browser SDK 2 version used by the default Amplitude CDN loader URL.
4
4
  *
@@ -127,31 +127,30 @@ declare global {
127
127
  export declare const amplitudeManifest: {
128
128
  readonly kind: "c15t.vendor-manifest";
129
129
  readonly schemaVersion: 1;
130
- readonly vendor: 'amplitude';
131
130
  readonly category: 'measurement';
132
131
  readonly install: [{
133
- readonly type: 'setGlobal';
132
+ readonly ifUndefined: true;
134
133
  readonly name: 'amplitude';
134
+ readonly type: 'setGlobal';
135
135
  readonly value: {
136
- readonly _q: readonly [];
137
136
  readonly _iq: {};
137
+ readonly _q: readonly [];
138
138
  readonly invoked: true;
139
139
  };
140
- readonly ifUndefined: true;
141
140
  }, {
142
- readonly type: 'defineQueueClass';
143
- readonly target: 'amplitude';
141
+ readonly methods: ["set", "setOnce", "add", "append", "prepend", "preInsert", "postInsert", "remove", "unset", "clearAll", "getUserProperties"];
144
142
  readonly name: 'Identify';
145
143
  readonly queueProperty: '_q';
146
- readonly methods: ["set", "setOnce", "add", "append", "prepend", "preInsert", "postInsert", "remove", "unset", "clearAll", "getUserProperties"];
147
- }, {
148
- readonly type: 'defineQueueMethods';
149
144
  readonly target: 'amplitude';
145
+ readonly type: 'defineQueueClass';
146
+ }, {
147
+ readonly methods: ["init", "track", "identify", "flush"];
150
148
  readonly queue: {
151
149
  readonly property: '_q';
152
150
  };
153
151
  readonly queueFormat: 'wrappedMethodCall';
154
- readonly methods: ["init", "track", "identify", "flush"];
152
+ readonly target: 'amplitude';
153
+ readonly type: 'defineQueueMethods';
155
154
  }, {
156
155
  readonly type: 'defineQueueMethods';
157
156
  readonly target: 'amplitude';
@@ -161,33 +160,34 @@ export declare const amplitudeManifest: {
161
160
  readonly queueFormat: 'voidMethodCall';
162
161
  readonly methods: ["setUserId", "setOptOut"];
163
162
  }, {
164
- readonly type: 'callGlobal';
163
+ readonly args: ["{{apiKey}}", "{{initOptions}}"];
165
164
  readonly global: 'amplitude';
166
165
  readonly method: 'init';
167
- readonly args: ["{{apiKey}}", "{{initOptions}}"];
166
+ readonly type: 'callGlobal';
168
167
  }, {
169
- readonly type: 'loadScript';
170
- readonly src: '{{scriptUrl}}';
171
168
  readonly async: true;
169
+ readonly src: '{{scriptUrl}}';
170
+ readonly type: 'loadScript';
172
171
  }];
173
- readonly onLoadDenied: [{
174
- readonly type: 'callGlobal';
172
+ readonly onConsentDenied: [{
173
+ readonly args: [true];
175
174
  readonly global: 'amplitude';
176
175
  readonly method: 'setOptOut';
177
- readonly args: [true];
176
+ readonly type: 'callGlobal';
178
177
  }];
179
178
  readonly onConsentGranted: [{
180
- readonly type: 'callGlobal';
179
+ readonly args: [false];
181
180
  readonly global: 'amplitude';
182
181
  readonly method: 'setOptOut';
183
- readonly args: [false];
184
- }];
185
- readonly onConsentDenied: [{
186
182
  readonly type: 'callGlobal';
183
+ }];
184
+ readonly onLoadDenied: [{
185
+ readonly args: [true];
187
186
  readonly global: 'amplitude';
188
187
  readonly method: 'setOptOut';
189
- readonly args: [true];
188
+ readonly type: 'callGlobal';
190
189
  }];
190
+ readonly vendor: 'amplitude';
191
191
  };
192
192
  export interface AmplitudeOptions {
193
193
  /** Amplitude project API key. */
@@ -231,4 +231,4 @@ export interface AmplitudeOptions {
231
231
  * });
232
232
  * ```
233
233
  */
234
- export declare function amplitude({ apiKey, initOptions, scriptUrl, }: AmplitudeOptions): Script;
234
+ export declare const amplitude: ({ apiKey, initOptions, scriptUrl, }: AmplitudeOptions) => Script;
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  /**
3
3
  * Clearbit vendor manifest.
4
4
  *
@@ -11,15 +11,15 @@ import type { Script } from 'c15t';
11
11
  export declare const clearbitManifest: {
12
12
  readonly kind: "c15t.vendor-manifest";
13
13
  readonly schemaVersion: 1;
14
- readonly vendor: 'clearbit';
15
14
  readonly category: 'marketing';
16
15
  readonly install: [{
17
- readonly type: 'loadScript';
18
- readonly src: '{{scriptUrl}}';
19
16
  readonly attributes: {
20
17
  readonly referrerpolicy: 'strict-origin-when-cross-origin';
21
18
  };
19
+ readonly src: '{{scriptUrl}}';
20
+ readonly type: 'loadScript';
22
21
  }];
22
+ readonly vendor: 'clearbit';
23
23
  };
24
24
  export interface ClearbitOptions {
25
25
  /**
@@ -57,4 +57,4 @@ export interface ClearbitOptions {
57
57
  * });
58
58
  * ```
59
59
  */
60
- export declare function clearbit(options: ClearbitOptions): Script;
60
+ export declare const clearbit: (options: ClearbitOptions) => Script;
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  declare global {
3
3
  interface Window {
4
4
  __cfBeacon?: {
@@ -17,16 +17,16 @@ declare global {
17
17
  export declare const cloudflareWebAnalyticsManifest: {
18
18
  readonly kind: "c15t.vendor-manifest";
19
19
  readonly schemaVersion: 1;
20
- readonly vendor: 'cloudflare-web-analytics';
21
20
  readonly category: 'measurement';
22
21
  readonly install: [{
23
- readonly type: 'loadScript';
24
- readonly src: '{{scriptUrl}}';
25
- readonly defer: true;
26
22
  readonly attributes: {
27
23
  readonly 'data-cf-beacon': '{{beaconConfig}}';
28
24
  };
25
+ readonly defer: true;
26
+ readonly src: '{{scriptUrl}}';
27
+ readonly type: 'loadScript';
29
28
  }];
29
+ readonly vendor: 'cloudflare-web-analytics';
30
30
  };
31
31
  export interface CloudflareWebAnalyticsOptions {
32
32
  /**
@@ -64,4 +64,4 @@ export interface CloudflareWebAnalyticsOptions {
64
64
  * });
65
65
  * ```
66
66
  */
67
- export declare function cloudflareWebAnalytics(options: CloudflareWebAnalyticsOptions): Script;
67
+ export declare const cloudflareWebAnalytics: (options: CloudflareWebAnalyticsOptions) => Script;
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  declare global {
3
3
  interface Window {
4
4
  databuddy?: {
@@ -29,61 +29,61 @@ declare global {
29
29
  export declare const databuddyManifest: {
30
30
  readonly kind: "c15t.vendor-manifest";
31
31
  readonly schemaVersion: 1;
32
- readonly vendor: 'databuddy';
33
- readonly category: 'measurement';
34
32
  readonly alwaysLoad: true;
33
+ readonly category: 'measurement';
35
34
  readonly install: [{
36
- readonly type: 'loadScript';
37
- readonly src: '{{scriptUrl}}';
38
35
  readonly async: true;
39
36
  readonly attributes: {
40
37
  readonly crossorigin: 'anonymous';
41
- readonly 'data-client-id': '{{clientId}}';
42
38
  readonly 'data-api-url': '{{apiUrl}}';
39
+ readonly 'data-client-id': '{{clientId}}';
43
40
  };
41
+ readonly src: '{{scriptUrl}}';
42
+ readonly type: 'loadScript';
44
43
  }];
45
- readonly onBeforeLoadGranted: [{
44
+ readonly onBeforeLoadDenied: [{
45
+ readonly ifUndefined: true;
46
+ readonly name: 'databuddyConfig';
46
47
  readonly type: 'setGlobal';
48
+ readonly value: '{{configWhenDenied}}';
49
+ }];
50
+ readonly onBeforeLoadGranted: [{
51
+ readonly ifUndefined: true;
47
52
  readonly name: 'databuddyConfig';
53
+ readonly type: 'setGlobal';
48
54
  readonly value: '{{configWhenGranted}}';
49
- readonly ifUndefined: true;
50
55
  }];
51
- readonly onBeforeLoadDenied: [{
52
- readonly type: 'setGlobal';
56
+ readonly onConsentDenied: [{
57
+ readonly ifUndefined: false;
53
58
  readonly name: 'databuddyConfig';
59
+ readonly type: 'setGlobal';
54
60
  readonly value: '{{configWhenDenied}}';
55
- readonly ifUndefined: true;
56
- }];
57
- readonly onLoadGranted: [{
58
- readonly type: 'setGlobalPath';
61
+ }, {
59
62
  readonly path: ["databuddy", "options", "disabled"];
60
- readonly value: false;
61
- }];
62
- readonly onLoadDenied: [{
63
63
  readonly type: 'setGlobalPath';
64
- readonly path: ["databuddy", "options", "disabled"];
65
64
  readonly value: true;
66
65
  }];
67
66
  readonly onConsentGranted: [{
68
- readonly type: 'setGlobal';
67
+ readonly ifUndefined: false;
69
68
  readonly name: 'databuddyConfig';
69
+ readonly type: 'setGlobal';
70
70
  readonly value: '{{configWhenGranted}}';
71
- readonly ifUndefined: false;
72
71
  }, {
73
- readonly type: 'setGlobalPath';
74
72
  readonly path: ["databuddy", "options", "disabled"];
73
+ readonly type: 'setGlobalPath';
75
74
  readonly value: false;
76
75
  }];
77
- readonly onConsentDenied: [{
78
- readonly type: 'setGlobal';
79
- readonly name: 'databuddyConfig';
80
- readonly value: '{{configWhenDenied}}';
81
- readonly ifUndefined: false;
82
- }, {
83
- readonly type: 'setGlobalPath';
76
+ readonly onLoadDenied: [{
84
77
  readonly path: ["databuddy", "options", "disabled"];
78
+ readonly type: 'setGlobalPath';
85
79
  readonly value: true;
86
80
  }];
81
+ readonly onLoadGranted: [{
82
+ readonly path: ["databuddy", "options", "disabled"];
83
+ readonly type: 'setGlobalPath';
84
+ readonly value: false;
85
+ }];
86
+ readonly vendor: 'databuddy';
87
87
  };
88
88
  export interface DatabuddyConsentOptions {
89
89
  /**
@@ -117,10 +117,13 @@ export interface DatabuddyConsentOptions {
117
117
  *
118
118
  * @example
119
119
  * ```ts
120
- * import { configureConsentManager } from 'c15t';
120
+ * import { createConsentKernel } from 'c15t';
121
+ * import { createScriptLoader } from 'c15t/modules/script-loader';
121
122
  * import { databuddy } from '@c15t/scripts/databuddy';
122
123
  *
123
- * configureConsentManager({
124
+ * const kernel = createConsentKernel();
125
+ * const loader = createScriptLoader({
126
+ * kernel,
124
127
  * scripts: [
125
128
  * databuddy({
126
129
  * clientId: 'db_1234567890abcdef',
@@ -141,4 +144,4 @@ export interface DatabuddyConsentOptions {
141
144
  * });
142
145
  * ```
143
146
  */
144
- export declare function databuddy(options: DatabuddyConsentOptions): Script;
147
+ export declare const databuddy: (options: DatabuddyConsentOptions) => Script;
@@ -1,4 +1,4 @@
1
- import type { Script } from 'c15t';
1
+ import type { Script } from '@c15t/core';
2
2
  declare global {
3
3
  interface Window {
4
4
  fathom?: {
@@ -25,20 +25,20 @@ declare global {
25
25
  export declare const fathomAnalyticsManifest: {
26
26
  readonly kind: "c15t.vendor-manifest";
27
27
  readonly schemaVersion: 1;
28
- readonly vendor: 'fathom-analytics';
29
28
  readonly category: 'measurement';
30
29
  readonly install: [{
31
- readonly type: 'loadScript';
32
- readonly src: '{{scriptUrl}}';
33
- readonly defer: true;
34
30
  readonly attributes: {
35
- readonly 'data-site': '{{site}}';
36
- readonly 'data-spa': '{{spa}}';
37
31
  readonly 'data-auto': '{{autoAttribute}}';
38
32
  readonly 'data-canonical': '{{canonicalAttribute}}';
39
33
  readonly 'data-honor-dnt': '{{honorDntAttribute}}';
34
+ readonly 'data-site': '{{site}}';
35
+ readonly 'data-spa': '{{spa}}';
40
36
  };
37
+ readonly defer: true;
38
+ readonly src: '{{scriptUrl}}';
39
+ readonly type: 'loadScript';
41
40
  }];
41
+ readonly vendor: 'fathom-analytics';
42
42
  };
43
43
  export interface FathomAnalyticsOptions {
44
44
  /**
@@ -87,4 +87,4 @@ export interface FathomAnalyticsOptions {
87
87
  * });
88
88
  * ```
89
89
  */
90
- export declare function fathomAnalytics(options: FathomAnalyticsOptions): Script;
90
+ export declare const fathomAnalytics: (options: FathomAnalyticsOptions) => Script;