@nuxt/scripts 1.0.0-beta.2 → 1.0.0-beta.21

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 (165) hide show
  1. package/README.md +3 -3
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/{DvH517bE.js → BlmrFwhD.js} +1 -1
  5. package/dist/client/_nuxt/{DfLgoB--.js → BwCYQWJt.js} +1 -1
  6. package/dist/client/_nuxt/DvbTvDd0.js +162 -0
  7. package/dist/client/_nuxt/{B66N9HCo.js → ZrewjUYk.js} +1 -1
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/6660a023-888d-415f-b66d-ce774e6f8f11.json +1 -0
  10. package/dist/client/_nuxt/entry.CACgbLJl.css +1 -0
  11. package/dist/client/_nuxt/error-404.CHeaW3dp.css +1 -0
  12. package/dist/client/_nuxt/error-500.DvOvWme_.css +1 -0
  13. package/dist/client/index.html +1 -1
  14. package/dist/module.d.mts +27 -18
  15. package/dist/module.d.ts +178 -0
  16. package/dist/module.json +1 -1
  17. package/dist/module.mjs +763 -526
  18. package/dist/registry.d.ts +6 -0
  19. package/dist/registry.mjs +109 -21
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +2 -2
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +7 -7
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +2 -2
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +6 -6
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +7 -7
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +6 -6
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +12 -12
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +6 -6
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +1 -1
  29. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +6 -6
  30. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +1 -1
  31. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +5 -5
  32. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +7 -7
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +7 -7
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +7 -7
  35. package/dist/runtime/components/ScriptCrisp.vue +1 -1
  36. package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
  37. package/dist/runtime/components/ScriptGravatar.d.vue.ts +22 -0
  38. package/dist/runtime/components/ScriptGravatar.vue +46 -0
  39. package/dist/runtime/components/ScriptGravatar.vue.d.ts +22 -0
  40. package/dist/runtime/components/ScriptInstagramEmbed.vue +1 -1
  41. package/dist/runtime/components/ScriptIntercom.vue +4 -3
  42. package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +43 -32
  43. package/dist/runtime/components/ScriptPayPalButtons.vue +48 -79
  44. package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +43 -32
  45. package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +37 -23
  46. package/dist/runtime/components/ScriptPayPalMessages.vue +46 -50
  47. package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +37 -23
  48. package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
  49. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +9 -0
  50. package/dist/runtime/components/ScriptVimeoPlayer.vue +13 -10
  51. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +9 -0
  52. package/dist/runtime/components/ScriptXEmbed.d.vue.ts +1 -1
  53. package/dist/runtime/components/ScriptXEmbed.vue +1 -1
  54. package/dist/runtime/components/ScriptXEmbed.vue.d.ts +1 -1
  55. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +2 -2
  56. package/dist/runtime/components/ScriptYouTubePlayer.vue +11 -5
  57. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +2 -2
  58. package/dist/runtime/composables/useScript.js +11 -6
  59. package/dist/runtime/composables/useScriptEventPage.js +2 -2
  60. package/dist/runtime/composables/useScriptTriggerConsent.js +1 -1
  61. package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
  62. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
  63. package/dist/runtime/registry/clarity.d.ts +10 -15
  64. package/dist/runtime/registry/clarity.js +22 -31
  65. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -13
  66. package/dist/runtime/registry/cloudflare-web-analytics.js +2 -14
  67. package/dist/runtime/registry/crisp.d.ts +9 -39
  68. package/dist/runtime/registry/crisp.js +2 -33
  69. package/dist/runtime/registry/databuddy-analytics.d.ts +2 -35
  70. package/dist/runtime/registry/databuddy-analytics.js +20 -45
  71. package/dist/runtime/registry/fathom-analytics.d.ts +6 -25
  72. package/dist/runtime/registry/fathom-analytics.js +2 -24
  73. package/dist/runtime/registry/google-adsense.d.ts +2 -10
  74. package/dist/runtime/registry/google-adsense.js +2 -11
  75. package/dist/runtime/registry/google-analytics.d.ts +3 -5
  76. package/dist/runtime/registry/google-analytics.js +3 -8
  77. package/dist/runtime/registry/google-maps.d.ts +3 -9
  78. package/dist/runtime/registry/google-maps.js +2 -8
  79. package/dist/runtime/registry/google-recaptcha.d.ts +2 -6
  80. package/dist/runtime/registry/google-recaptcha.js +4 -12
  81. package/dist/runtime/registry/google-sign-in.d.ts +2 -13
  82. package/dist/runtime/registry/google-sign-in.js +2 -22
  83. package/dist/runtime/registry/google-tag-manager.d.ts +3 -28
  84. package/dist/runtime/registry/google-tag-manager.js +4 -27
  85. package/dist/runtime/registry/gravatar.d.ts +25 -0
  86. package/dist/runtime/registry/gravatar.js +32 -0
  87. package/dist/runtime/registry/hotjar.d.ts +3 -5
  88. package/dist/runtime/registry/hotjar.js +2 -5
  89. package/dist/runtime/registry/instagram-embed.d.ts +2 -17
  90. package/dist/runtime/registry/instagram-embed.js +4 -19
  91. package/dist/runtime/registry/intercom.d.ts +3 -11
  92. package/dist/runtime/registry/intercom.js +2 -12
  93. package/dist/runtime/registry/matomo-analytics.d.ts +2 -11
  94. package/dist/runtime/registry/matomo-analytics.js +3 -12
  95. package/dist/runtime/registry/meta-pixel.d.ts +3 -5
  96. package/dist/runtime/registry/meta-pixel.js +2 -4
  97. package/dist/runtime/registry/npm.d.ts +2 -6
  98. package/dist/runtime/registry/npm.js +2 -9
  99. package/dist/runtime/registry/paypal.d.ts +4 -25
  100. package/dist/runtime/registry/paypal.js +3 -66
  101. package/dist/runtime/registry/plausible-analytics.js +18 -13
  102. package/dist/runtime/registry/posthog.d.ts +10 -11
  103. package/dist/runtime/registry/posthog.js +7 -20
  104. package/dist/runtime/registry/reddit-pixel.d.ts +4 -5
  105. package/dist/runtime/registry/reddit-pixel.js +2 -4
  106. package/dist/runtime/registry/rybbit-analytics.d.ts +2 -14
  107. package/dist/runtime/registry/rybbit-analytics.js +7 -19
  108. package/dist/runtime/registry/schemas.d.ts +946 -0
  109. package/dist/runtime/registry/schemas.js +901 -0
  110. package/dist/runtime/registry/segment.d.ts +2 -5
  111. package/dist/runtime/registry/segment.js +2 -5
  112. package/dist/runtime/registry/snapchat-pixel.d.ts +3 -32
  113. package/dist/runtime/registry/snapchat-pixel.js +2 -20
  114. package/dist/runtime/registry/stripe.d.ts +3 -4
  115. package/dist/runtime/registry/stripe.js +2 -4
  116. package/dist/runtime/registry/tiktok-pixel.d.ts +3 -6
  117. package/dist/runtime/registry/tiktok-pixel.js +2 -6
  118. package/dist/runtime/registry/umami-analytics.d.ts +2 -31
  119. package/dist/runtime/registry/umami-analytics.js +2 -36
  120. package/dist/runtime/registry/vercel-analytics.d.ts +29 -0
  121. package/dist/runtime/registry/vercel-analytics.js +84 -0
  122. package/dist/runtime/registry/vimeo-player.d.ts +2 -2
  123. package/dist/runtime/registry/vimeo-player.js +1 -1
  124. package/dist/runtime/registry/x-embed.d.ts +2 -16
  125. package/dist/runtime/registry/x-embed.js +2 -17
  126. package/dist/runtime/registry/x-pixel.d.ts +3 -6
  127. package/dist/runtime/registry/x-pixel.js +2 -5
  128. package/dist/runtime/registry/youtube-player.d.ts +7 -7
  129. package/dist/runtime/registry/youtube-player.js +1 -1
  130. package/dist/runtime/server/google-static-maps-proxy.js +1 -1
  131. package/dist/runtime/server/{sw-handler.d.ts → gravatar-proxy.d.ts} +1 -1
  132. package/dist/runtime/server/gravatar-proxy.js +62 -0
  133. package/dist/runtime/server/instagram-embed-asset.js +2 -1
  134. package/dist/runtime/server/instagram-embed-image.js +2 -1
  135. package/dist/runtime/server/instagram-embed.js +22 -13
  136. package/dist/runtime/server/proxy-handler.js +161 -117
  137. package/dist/runtime/server/utils/privacy.d.ts +45 -1
  138. package/dist/runtime/server/utils/privacy.js +103 -40
  139. package/dist/runtime/server/x-embed.js +3 -2
  140. package/dist/runtime/types.d.ts +35 -24
  141. package/dist/runtime/utils/pure.d.ts +0 -4
  142. package/dist/runtime/utils/pure.js +0 -67
  143. package/dist/runtime/utils.d.ts +3 -3
  144. package/dist/runtime/utils.js +12 -7
  145. package/dist/shared/scripts.Crpn87WB.mjs +318 -0
  146. package/dist/stats.d.mts +39 -0
  147. package/dist/stats.d.ts +39 -0
  148. package/dist/stats.mjs +772 -0
  149. package/dist/types-source.d.mts +19 -0
  150. package/dist/types-source.d.ts +19 -0
  151. package/dist/types-source.mjs +975 -0
  152. package/package.json +42 -31
  153. package/dist/client/_nuxt/B8XOar-X.js +0 -162
  154. package/dist/client/_nuxt/builds/meta/133a46c5-a5c1-4a63-87d1-037947a5bcdb.json +0 -1
  155. package/dist/client/_nuxt/entry.D45OuV0w.css +0 -1
  156. package/dist/client/_nuxt/error-404.B57D-jUQ.css +0 -1
  157. package/dist/client/_nuxt/error-500.DTHUW7BI.css +0 -1
  158. package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +0 -52
  159. package/dist/runtime/components/ScriptPayPalMarks.vue +0 -69
  160. package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +0 -52
  161. package/dist/runtime/plugins/sw-register.client.d.ts +0 -2
  162. package/dist/runtime/plugins/sw-register.client.js +0 -12
  163. package/dist/runtime/server/sw-handler.js +0 -25
  164. package/dist/runtime/sw/proxy-sw.template.d.ts +0 -1
  165. package/dist/runtime/sw/proxy-sw.template.js +0 -54
@@ -0,0 +1,901 @@
1
+ import { any, array, boolean, custom, literal, minLength, number, object, optional, pipe, record, string, union } from "#nuxt-scripts-validator";
2
+ export const ClarityOptions = object({
3
+ /**
4
+ * The Clarity token.
5
+ * @see https://learn.microsoft.com/en-us/clarity/setup-clarity
6
+ */
7
+ id: pipe(string(), minLength(10))
8
+ });
9
+ export const CloudflareWebAnalyticsOptions = object({
10
+ /**
11
+ * The Cloudflare Web Analytics token.
12
+ * @see https://developers.cloudflare.com/analytics/web-analytics/get-started/
13
+ */
14
+ token: pipe(string(), minLength(32)),
15
+ /**
16
+ * Cloudflare Web Analytics enables measuring SPAs automatically by overriding the History API's pushState function
17
+ * and listening to the onpopstate. Hash-based router is not supported.
18
+ *
19
+ * @default true
20
+ * @see https://developers.cloudflare.com/analytics/web-analytics/get-started/#spa-tracking
21
+ */
22
+ spa: optional(boolean())
23
+ });
24
+ export const CrispOptions = object({
25
+ /**
26
+ * The Crisp ID.
27
+ */
28
+ id: string(),
29
+ /**
30
+ * Extra configuration options. Used to configure the locale.
31
+ * Same as CRISP_RUNTIME_CONFIG.
32
+ * @see https://docs.crisp.chat/guides/chatbox-sdks/web-sdk/language-customization/
33
+ */
34
+ runtimeConfig: optional(object({
35
+ locale: optional(string())
36
+ })),
37
+ /**
38
+ * Associated a session, equivalent to using CRISP_TOKEN_ID variable.
39
+ * Same as CRISP_TOKEN_ID.
40
+ * @see https://docs.crisp.chat/guides/chatbox-sdks/web-sdk/session-continuity/
41
+ */
42
+ tokenId: optional(string()),
43
+ /**
44
+ * Restrict the domain that the Crisp cookie is set on.
45
+ * Same as CRISP_COOKIE_DOMAIN.
46
+ * @see https://docs.crisp.chat/guides/chatbox-sdks/web-sdk/cookie-policies/
47
+ */
48
+ cookieDomain: optional(string()),
49
+ /**
50
+ * The cookie expiry in seconds.
51
+ * Same as CRISP_COOKIE_EXPIRATION.
52
+ * @see https://docs.crisp.chat/guides/chatbox-sdks/web-sdk/cookie-policies/#change-cookie-expiration-date
53
+ */
54
+ cookieExpiry: optional(number())
55
+ });
56
+ export const DatabuddyAnalyticsOptions = object({
57
+ /**
58
+ * Your Databuddy client ID.
59
+ */
60
+ clientId: string(),
61
+ /**
62
+ * Custom script URL for the Databuddy SDK.
63
+ * @default 'https://cdn.databuddy.cc/databuddy.js'
64
+ */
65
+ scriptUrl: optional(string()),
66
+ /**
67
+ * Custom API URL for sending analytics data.
68
+ * @default 'https://basket.databuddy.cc'
69
+ */
70
+ apiUrl: optional(string()),
71
+ /**
72
+ * Disable all tracking when set to `true`.
73
+ */
74
+ disabled: optional(boolean()),
75
+ /**
76
+ * Track screen/page views automatically.
77
+ * @default true
78
+ * @see https://www.databuddy.cc/docs/sdk#track-screen-views
79
+ */
80
+ trackScreenViews: optional(boolean()),
81
+ /**
82
+ * Track page performance metrics.
83
+ * @default true
84
+ * @see https://www.databuddy.cc/docs/sdk#track-performance
85
+ */
86
+ trackPerformance: optional(boolean()),
87
+ /**
88
+ * Track user sessions.
89
+ * @default true
90
+ * @see https://www.databuddy.cc/docs/sdk#track-sessions
91
+ */
92
+ trackSessions: optional(boolean()),
93
+ /**
94
+ * Track Web Vitals (LCP, FID, CLS, etc.).
95
+ */
96
+ trackWebVitals: optional(boolean()),
97
+ /**
98
+ * Track JavaScript errors.
99
+ */
100
+ trackErrors: optional(boolean()),
101
+ /**
102
+ * Track outgoing link clicks.
103
+ */
104
+ trackOutgoingLinks: optional(boolean()),
105
+ /**
106
+ * Track scroll depth.
107
+ */
108
+ trackScrollDepth: optional(boolean()),
109
+ /**
110
+ * Track user engagement time.
111
+ */
112
+ trackEngagement: optional(boolean()),
113
+ /**
114
+ * Track user interactions (clicks, form submissions, etc.).
115
+ */
116
+ trackInteractions: optional(boolean()),
117
+ /**
118
+ * Track element attributes for detailed interaction context.
119
+ */
120
+ trackAttributes: optional(boolean()),
121
+ /**
122
+ * Track hash changes in the URL.
123
+ */
124
+ trackHashChanges: optional(boolean()),
125
+ /**
126
+ * Track exit intent behavior.
127
+ */
128
+ trackExitIntent: optional(boolean()),
129
+ /**
130
+ * Track bounce rate metrics.
131
+ */
132
+ trackBounceRate: optional(boolean()),
133
+ /**
134
+ * Enable event batching for better performance.
135
+ */
136
+ enableBatching: optional(boolean()),
137
+ /**
138
+ * Maximum number of events per batch.
139
+ */
140
+ batchSize: optional(number()),
141
+ /**
142
+ * Timeout (in ms) before flushing a batch.
143
+ */
144
+ batchTimeout: optional(number()),
145
+ /**
146
+ * Enable automatic retries for failed requests.
147
+ */
148
+ enableRetries: optional(boolean()),
149
+ /**
150
+ * Maximum number of retry attempts.
151
+ */
152
+ maxRetries: optional(number()),
153
+ /**
154
+ * Initial delay (in ms) before the first retry.
155
+ */
156
+ initialRetryDelay: optional(number()),
157
+ /**
158
+ * Sampling rate (0 to 1). Set to `0.5` to track ~50% of sessions.
159
+ */
160
+ samplingRate: optional(number()),
161
+ /**
162
+ * Custom SDK identifier.
163
+ */
164
+ sdk: optional(string()),
165
+ /**
166
+ * Custom SDK version string.
167
+ */
168
+ sdkVersion: optional(string()),
169
+ /**
170
+ * Enable observability/monitoring features.
171
+ */
172
+ enableObservability: optional(boolean()),
173
+ /**
174
+ * The service name for observability reporting.
175
+ */
176
+ observabilityService: optional(string()),
177
+ /**
178
+ * The environment name for observability (e.g., `'production'`, `'staging'`).
179
+ */
180
+ observabilityEnvironment: optional(string()),
181
+ /**
182
+ * The version string for observability reporting.
183
+ */
184
+ observabilityVersion: optional(string()),
185
+ /**
186
+ * Enable console logging for debugging.
187
+ */
188
+ enableLogging: optional(boolean()),
189
+ /**
190
+ * Enable request tracing.
191
+ */
192
+ enableTracing: optional(boolean()),
193
+ /**
194
+ * Enable error tracking via observability.
195
+ */
196
+ enableErrorTracking: optional(boolean())
197
+ });
198
+ export const FathomAnalyticsOptions = object({
199
+ /**
200
+ * The Fathom Analytics site ID.
201
+ * @see https://usefathom.com/docs/script/script-settings
202
+ */
203
+ site: string(),
204
+ /**
205
+ * The Fathom Analytics tracking mode.
206
+ * @default 'auto'
207
+ */
208
+ spa: optional(union([literal("auto"), literal("history"), literal("hash")])),
209
+ /**
210
+ * Automatically track page views.
211
+ * @default true
212
+ */
213
+ auto: optional(boolean()),
214
+ /**
215
+ * Enable canonical URL tracking.
216
+ * @default true
217
+ */
218
+ canonical: optional(boolean()),
219
+ /**
220
+ * Honor Do Not Track requests.
221
+ * @default false
222
+ */
223
+ honorDnt: optional(boolean())
224
+ });
225
+ export const GoogleAdsenseOptions = object({
226
+ /**
227
+ * The Google Adsense ID.
228
+ * @example 'ca-pub-XXXXXXXXXXXXXXXX'
229
+ */
230
+ client: optional(string()),
231
+ /**
232
+ * Enable or disable Auto Ads.
233
+ * @default false
234
+ * @see https://support.google.com/adsense/answer/9261805
235
+ */
236
+ autoAds: optional(boolean())
237
+ });
238
+ export const GoogleAnalyticsOptions = object({
239
+ /**
240
+ * The GA4 measurement ID.
241
+ * @example 'G-XXXXXXXX'
242
+ * @see https://developers.google.com/analytics/devguides/collection/gtagjs
243
+ */
244
+ id: optional(string()),
245
+ /**
246
+ * Global name for the dataLayer variable.
247
+ * @default 'dataLayer'
248
+ * @see https://developers.google.com/analytics/devguides/collection/gtagjs/setting-up-gtag#rename_the_data_layer
249
+ */
250
+ l: optional(string())
251
+ });
252
+ export const GoogleMapsOptions = object({
253
+ /**
254
+ * Your Google Maps API key.
255
+ */
256
+ apiKey: string(),
257
+ /**
258
+ * The Google Maps libraries to load.
259
+ * @default ['places']
260
+ * @see https://developers.google.com/maps/documentation/javascript/libraries
261
+ */
262
+ libraries: optional(array(string())),
263
+ /**
264
+ * The language code for the map UI and geocoding results.
265
+ * @see https://developers.google.com/maps/faq#languagesupport
266
+ */
267
+ language: optional(string()),
268
+ /**
269
+ * The region code to bias geocoding results.
270
+ * @see https://developers.google.com/maps/documentation/javascript/localization#Region
271
+ */
272
+ region: optional(string()),
273
+ /**
274
+ * The Google Maps JS API version to load.
275
+ * @default 'weekly'
276
+ * @see https://developers.google.com/maps/documentation/javascript/versions
277
+ */
278
+ v: optional(union([literal("weekly"), literal("quarterly"), literal("beta"), literal("alpha"), string()]))
279
+ });
280
+ export const GoogleRecaptchaOptions = object({
281
+ /**
282
+ * Your reCAPTCHA site key.
283
+ * @see https://developers.google.com/recaptcha/docs/display#render_param
284
+ */
285
+ siteKey: string(),
286
+ /**
287
+ * Use the Enterprise version of reCAPTCHA (enterprise.js instead of api.js).
288
+ * @see https://cloud.google.com/recaptcha-enterprise/docs/introduction
289
+ */
290
+ enterprise: optional(boolean()),
291
+ /**
292
+ * Use recaptcha.net instead of google.com domain. Useful for regions where google.com is blocked.
293
+ */
294
+ recaptchaNet: optional(boolean()),
295
+ /**
296
+ * Language code for the reCAPTCHA widget.
297
+ * @see https://developers.google.com/recaptcha/docs/language
298
+ */
299
+ hl: optional(string())
300
+ });
301
+ export const GoogleSignInOptions = object({
302
+ /**
303
+ * Your Google API client ID.
304
+ * @example 'XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com'
305
+ * @see https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid
306
+ */
307
+ clientId: string(),
308
+ /**
309
+ * Auto-select credentials when only one Google account is available.
310
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#auto_select
311
+ */
312
+ autoSelect: optional(boolean()),
313
+ /**
314
+ * The context text for the One Tap prompt.
315
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#context
316
+ */
317
+ context: optional(union([literal("signin"), literal("signup"), literal("use")])),
318
+ /**
319
+ * Enable FedCM (Federated Credential Management) API support. Mandatory from August 2025.
320
+ * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration
321
+ */
322
+ useFedcmForPrompt: optional(boolean()),
323
+ /**
324
+ * Cancel the One Tap prompt if the user clicks outside.
325
+ * @default true
326
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#cancel_on_tap_outside
327
+ */
328
+ cancelOnTapOutside: optional(boolean()),
329
+ /**
330
+ * The UX mode for the sign-in flow.
331
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#ux_mode
332
+ */
333
+ uxMode: optional(union([literal("popup"), literal("redirect")])),
334
+ /**
335
+ * The URI to redirect to after sign-in when using redirect UX mode.
336
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#login_uri
337
+ */
338
+ loginUri: optional(string()),
339
+ /**
340
+ * Enable Intelligent Tracking Prevention (ITP) support for Safari.
341
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#itp_support
342
+ */
343
+ itpSupport: optional(boolean()),
344
+ /**
345
+ * Allowed parent origin(s) for iframe embedding.
346
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#allowed_parent_origin
347
+ */
348
+ allowedParentOrigin: optional(union([string(), array(string())])),
349
+ /**
350
+ * Restrict sign-in to a specific Google Workspace hosted domain.
351
+ * @example 'example.com'
352
+ * @see https://developers.google.com/identity/gsi/web/reference/js-reference#hd
353
+ */
354
+ hd: optional(string())
355
+ });
356
+ export const GoogleTagManagerOptions = object({
357
+ /**
358
+ * GTM container ID (format: GTM-XXXXXX)
359
+ * @see https://developers.google.com/tag-platform/tag-manager/web#install-the-container
360
+ */
361
+ id: string(),
362
+ /**
363
+ * Optional dataLayer variable name
364
+ * @default 'dataLayer'
365
+ * @see https://developers.google.com/tag-platform/tag-manager/web/datalayer#rename_the_data_layer
366
+ */
367
+ l: optional(string()),
368
+ /**
369
+ * Authentication token for environment-specific container versions
370
+ * @see https://support.google.com/tagmanager/answer/6328337
371
+ */
372
+ auth: optional(string()),
373
+ /**
374
+ * Preview environment name
375
+ * @see https://support.google.com/tagmanager/answer/6328337
376
+ */
377
+ preview: optional(string()),
378
+ /** Forces GTM cookies to take precedence when true */
379
+ cookiesWin: optional(union([boolean(), literal("x")])),
380
+ /**
381
+ * Enables debug mode when true
382
+ * @see https://support.google.com/tagmanager/answer/6107056
383
+ */
384
+ debug: optional(union([boolean(), literal("x")])),
385
+ /**
386
+ * No Personal Advertising - disables advertising features when true
387
+ * @see https://developers.google.com/tag-platform/tag-manager/templates/consent-apis
388
+ */
389
+ npa: optional(union([boolean(), literal("1")])),
390
+ /** Custom dataLayer name (alternative to "l" property) */
391
+ dataLayer: optional(string()),
392
+ /**
393
+ * Environment name for environment-specific container
394
+ * @see https://support.google.com/tagmanager/answer/6328337
395
+ */
396
+ envName: optional(string()),
397
+ /** Referrer policy for analytics requests */
398
+ authReferrerPolicy: optional(string()),
399
+ /**
400
+ * Default consent settings for GTM
401
+ * @see https://developers.google.com/tag-platform/tag-manager/templates/consent-apis
402
+ */
403
+ defaultConsent: optional(record(string(), union([string(), number()])))
404
+ });
405
+ export const HotjarOptions = object({
406
+ /**
407
+ * Your Hotjar Site ID.
408
+ * @see https://help.hotjar.com/hc/en-us/articles/115012039247-Hotjar-Tracking-Code
409
+ */
410
+ id: number(),
411
+ /**
412
+ * The Hotjar snippet version.
413
+ * @default 6
414
+ */
415
+ sv: optional(number())
416
+ });
417
+ export const InstagramEmbedOptions = object({
418
+ /**
419
+ * The Instagram post URL to embed.
420
+ * @example 'https://www.instagram.com/p/C_XXXXXXXXX/'
421
+ * @see https://developers.facebook.com/docs/instagram/oembed/
422
+ */
423
+ postUrl: string(),
424
+ /**
425
+ * Whether to include captions in the embed.
426
+ * @default true
427
+ */
428
+ captions: optional(boolean()),
429
+ /**
430
+ * Custom API endpoint for fetching embed HTML.
431
+ * @default '/api/_scripts/instagram-embed'
432
+ */
433
+ apiEndpoint: optional(string())
434
+ });
435
+ export const IntercomOptions = object({
436
+ /**
437
+ * Your Intercom app ID.
438
+ * @see https://developers.intercom.com/installing-intercom/docs/javascript-api-attributes-objects
439
+ */
440
+ app_id: string(),
441
+ /**
442
+ * The regional API base URL. Choose based on your Intercom data hosting region.
443
+ */
444
+ api_base: optional(union([literal("https://api-iam.intercom.io"), literal("https://api-iam.eu.intercom.io"), literal("https://api-iam.au.intercom.io")])),
445
+ /**
446
+ * The name of the logged-in user.
447
+ */
448
+ name: optional(string()),
449
+ /**
450
+ * The email address of the logged-in user.
451
+ */
452
+ email: optional(string()),
453
+ /**
454
+ * A unique identifier for the logged-in user.
455
+ */
456
+ user_id: optional(string()),
457
+ /**
458
+ * The horizontal alignment of the Intercom messenger launcher.
459
+ * @default 'right'
460
+ */
461
+ alignment: optional(union([literal("left"), literal("right")])),
462
+ /**
463
+ * The horizontal padding (in px) of the messenger launcher from the edge of the page.
464
+ * @default 20
465
+ */
466
+ horizontal_padding: optional(number()),
467
+ /**
468
+ * The vertical padding (in px) of the messenger launcher from the bottom of the page.
469
+ * @default 20
470
+ */
471
+ vertical_padding: optional(number())
472
+ });
473
+ export const MatomoAnalyticsOptions = object({
474
+ /**
475
+ * The URL of your self-hosted Matomo instance.
476
+ * Either `matomoUrl` or `cloudId` is required.
477
+ * @example 'https://matomo.example.com'
478
+ * @see https://developer.matomo.org/guides/tracking-javascript-guide
479
+ */
480
+ matomoUrl: optional(string()),
481
+ /**
482
+ * Your Matomo site ID.
483
+ * @default '1'
484
+ */
485
+ siteId: optional(union([string(), number()])),
486
+ /**
487
+ * Your Matomo Cloud ID (the subdomain portion of your `*.matomo.cloud` URL).
488
+ * Either `matomoUrl` or `cloudId` is required.
489
+ * @example 'mysite.matomo.cloud'
490
+ */
491
+ cloudId: optional(string()),
492
+ /**
493
+ * A custom tracker URL. Overrides the default tracker endpoint derived from `matomoUrl` or `cloudId`.
494
+ */
495
+ trackerUrl: optional(string()),
496
+ /**
497
+ * Whether to track the initial page view on load.
498
+ * @deprecated Use `watch: true` (default) for automatic page view tracking.
499
+ */
500
+ trackPageView: optional(boolean()),
501
+ /**
502
+ * Enable download and outlink tracking.
503
+ */
504
+ enableLinkTracking: optional(boolean()),
505
+ /**
506
+ * Disable all tracking cookies for cookieless analytics.
507
+ */
508
+ disableCookies: optional(boolean()),
509
+ /**
510
+ * Automatically track page views on route change.
511
+ * @default true
512
+ */
513
+ watch: optional(boolean())
514
+ });
515
+ export const MetaPixelOptions = object({
516
+ /**
517
+ * Your Meta (Facebook) Pixel ID.
518
+ * @see https://developers.facebook.com/docs/meta-pixel/get-started
519
+ */
520
+ id: union([string(), number()])
521
+ });
522
+ export const NpmOptions = object({
523
+ /**
524
+ * The npm package name to load.
525
+ * @example 'lodash'
526
+ */
527
+ packageName: string(),
528
+ /**
529
+ * The specific file path within the package to load.
530
+ * @example '/dist/lodash.min.js'
531
+ */
532
+ file: optional(string()),
533
+ /**
534
+ * The package version to load.
535
+ * @default 'latest'
536
+ */
537
+ version: optional(string()),
538
+ /**
539
+ * The CDN provider to use for loading the package.
540
+ * @default 'unpkg'
541
+ * @see https://unpkg.com
542
+ * @see https://www.jsdelivr.com
543
+ * @see https://cdnjs.com
544
+ */
545
+ provider: optional(union([literal("jsdelivr"), literal("cdnjs"), literal("unpkg")]))
546
+ });
547
+ export const PayPalOptions = union([
548
+ object({
549
+ /**
550
+ * Your PayPal client ID.
551
+ * @see https://developer.paypal.com/sdk/js/reference/
552
+ */
553
+ clientId: string(),
554
+ clientToken: optional(string()),
555
+ /**
556
+ * Use the PayPal sandbox environment. Defaults to `true` in development.
557
+ */
558
+ sandbox: optional(boolean())
559
+ }),
560
+ object({
561
+ clientId: optional(string()),
562
+ /**
563
+ * A server-generated client token for authentication.
564
+ * @see https://docs.paypal.ai/payments/methods/paypal/sdk/js/v6/paypal-checkout
565
+ */
566
+ clientToken: string(),
567
+ /**
568
+ * Use the PayPal sandbox environment. Defaults to `true` in development.
569
+ */
570
+ sandbox: optional(boolean())
571
+ })
572
+ ]);
573
+ export const PostHogOptions = object({
574
+ /**
575
+ * Your PostHog project API key.
576
+ * @see https://posthog.com/docs/libraries/js#usage
577
+ */
578
+ apiKey: string(),
579
+ /**
580
+ * Your PostHog data region.
581
+ * @default 'us'
582
+ * @see https://posthog.com/docs/libraries/js#config
583
+ */
584
+ region: optional(union([literal("us"), literal("eu")])),
585
+ /**
586
+ * Custom API host URL. Overrides the default derived from `region`.
587
+ * Useful for self-hosted instances or reverse proxies.
588
+ */
589
+ apiHost: optional(string()),
590
+ /**
591
+ * Enable autocapture of clicks, form submissions, and page views.
592
+ * @default true
593
+ */
594
+ autocapture: optional(boolean()),
595
+ /**
596
+ * Capture page views automatically. Set to `'history_change'` to only capture on history changes.
597
+ * @default true
598
+ */
599
+ capturePageview: optional(union([boolean(), literal("history_change")])),
600
+ /**
601
+ * Capture page leave events automatically.
602
+ * @default true
603
+ */
604
+ capturePageleave: optional(boolean()),
605
+ /**
606
+ * Disable session recording.
607
+ */
608
+ disableSessionRecording: optional(boolean()),
609
+ /**
610
+ * Additional PostHog configuration options passed directly to `posthog.init()`.
611
+ * @see https://posthog.com/docs/libraries/js#config
612
+ */
613
+ config: optional(record(string(), any()))
614
+ });
615
+ export const RedditPixelOptions = object({
616
+ /**
617
+ * Your Reddit Pixel advertiser ID.
618
+ * @see https://reddithelp.com/en/categories/advertising/managing-ads/installing-reddit-pixel
619
+ */
620
+ id: string()
621
+ });
622
+ export const RybbitAnalyticsOptions = object({
623
+ /**
624
+ * Your Rybbit site ID.
625
+ * @see https://rybbit.io/docs
626
+ */
627
+ siteId: union([string(), number()]),
628
+ /**
629
+ * Automatically track page views.
630
+ * @default true
631
+ */
632
+ autoTrackPageview: optional(boolean()),
633
+ /**
634
+ * Enable SPA (single-page app) route tracking.
635
+ * @default true
636
+ */
637
+ trackSpa: optional(boolean()),
638
+ /**
639
+ * Include query parameters in tracked URLs.
640
+ */
641
+ trackQuery: optional(boolean()),
642
+ /**
643
+ * Track outbound link clicks.
644
+ */
645
+ trackOutbound: optional(boolean()),
646
+ /**
647
+ * Track JavaScript errors.
648
+ */
649
+ trackErrors: optional(boolean()),
650
+ /**
651
+ * Enable session replay recording.
652
+ */
653
+ sessionReplay: optional(boolean()),
654
+ /**
655
+ * Enable Web Vitals tracking (LCP, FID, CLS, etc.).
656
+ */
657
+ webVitals: optional(boolean()),
658
+ /**
659
+ * URL patterns to skip from tracking (glob syntax).
660
+ */
661
+ skipPatterns: optional(array(string())),
662
+ /**
663
+ * URL patterns to mask in tracked data (glob syntax).
664
+ */
665
+ maskPatterns: optional(array(string())),
666
+ /**
667
+ * Debounce interval (in ms) for page view tracking.
668
+ */
669
+ debounce: optional(number()),
670
+ /**
671
+ * API key for authenticated tracking.
672
+ */
673
+ apiKey: optional(string()),
674
+ /**
675
+ * Override the analytics host URL. When first-party mode is enabled, this is
676
+ * auto-injected to route through the proxy. The SDK derives its API endpoint
677
+ * from the script src, so this changes the script src to `${analyticsHost}/script.js`.
678
+ */
679
+ analyticsHost: optional(string())
680
+ });
681
+ export const SegmentOptions = object({
682
+ /**
683
+ * Your Segment write key.
684
+ * @see https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/quickstart/
685
+ */
686
+ writeKey: string(),
687
+ /**
688
+ * The global variable name for the analytics instance.
689
+ * @default 'analytics'
690
+ */
691
+ analyticsKey: optional(string())
692
+ });
693
+ export const InitObjectPropertiesSchema = object({
694
+ /**
695
+ * The user's email address (for matching).
696
+ */
697
+ user_email: optional(string()),
698
+ /**
699
+ * The user's IP address.
700
+ */
701
+ ip_address: optional(string()),
702
+ /**
703
+ * The user's phone number (for matching).
704
+ */
705
+ user_phone_number: optional(string()),
706
+ /**
707
+ * SHA-256 hashed email address.
708
+ */
709
+ user_hashed_email: optional(string()),
710
+ /**
711
+ * SHA-256 hashed phone number.
712
+ */
713
+ user_hashed_phone_number: optional(string()),
714
+ /**
715
+ * The user's first name.
716
+ */
717
+ firstname: optional(string()),
718
+ /**
719
+ * The user's last name.
720
+ */
721
+ lastname: optional(string()),
722
+ /**
723
+ * The user's city.
724
+ */
725
+ geo_city: optional(string()),
726
+ /**
727
+ * The user's region/state.
728
+ */
729
+ geo_region: optional(string()),
730
+ /**
731
+ * The user's postal/zip code.
732
+ */
733
+ geo_postal_code: optional(string()),
734
+ /**
735
+ * The user's country code.
736
+ */
737
+ geo_country: optional(string()),
738
+ /**
739
+ * The user's age.
740
+ */
741
+ age: optional(string())
742
+ });
743
+ export const SnapTrPixelOptions = object({
744
+ /**
745
+ * Your Snapchat Pixel ID.
746
+ * @see https://businesshelp.snapchat.com/s/article/pixel-website-install
747
+ */
748
+ id: string(),
749
+ /**
750
+ * Whether to automatically track a `PAGE_VIEW` event on initialization.
751
+ */
752
+ trackPageView: optional(boolean()),
753
+ ...InitObjectPropertiesSchema?.entries || {}
754
+ });
755
+ export const StripeOptions = object({
756
+ /**
757
+ * Whether to load Stripe's advanced fraud detection signals.
758
+ * Set to `false` to opt out.
759
+ * @default true
760
+ * @see https://docs.stripe.com/disputes/prevention/advanced-fraud-detection
761
+ */
762
+ advancedFraudSignals: optional(boolean())
763
+ });
764
+ export const TikTokPixelOptions = object({
765
+ /**
766
+ * Your TikTok Pixel ID.
767
+ * @see https://ads.tiktok.com/help/article/get-started-pixel
768
+ */
769
+ id: string(),
770
+ /**
771
+ * Whether to automatically track a page view on initialization.
772
+ * @default true
773
+ */
774
+ trackPageView: optional(boolean())
775
+ });
776
+ export const UmamiAnalyticsOptions = object({
777
+ /**
778
+ * Your Umami website ID.
779
+ * @see https://umami.is/docs/tracker-config
780
+ */
781
+ websiteId: string(),
782
+ // required
783
+ /**
784
+ * By default, Umami will send data to wherever the script is located.
785
+ * You can override this to send data to another location.
786
+ * @see https://umami.is/docs/tracker-config#data-host-url
787
+ */
788
+ hostUrl: optional(string()),
789
+ /**
790
+ * By default, Umami tracks all pageviews and events for you automatically.
791
+ * You can disable this behavior and track events yourself using the tracker functions.
792
+ * @default true
793
+ * @see https://umami.is/docs/tracker-functions
794
+ */
795
+ autoTrack: optional(boolean()),
796
+ /**
797
+ * If you want the tracker to only run on specific domains, you can add them to your tracker script.
798
+ * This is a comma delimited list of domain names.
799
+ * Helps if you are working in a staging/development environment.
800
+ * @see https://umami.is/docs/tracker-config#data-domains
801
+ */
802
+ domains: optional(array(string())),
803
+ /**
804
+ * If you want the tracker to collect events under a specific tag.
805
+ * Events can be filtered in the dashboard by a specific tag.
806
+ * @see https://umami.is/docs/tracker-config#data-tag
807
+ */
808
+ tag: optional(string()),
809
+ /**
810
+ * Function that will be called before data is sent to Umami.
811
+ * The function takes two parameters: type and payload.
812
+ * Return the payload to continue sending, or return a falsy value to cancel.
813
+ * @see https://umami.is/docs/tracker-config#data-before-send
814
+ */
815
+ beforeSend: optional(union([
816
+ custom((input) => typeof input === "function"),
817
+ string()
818
+ ]))
819
+ });
820
+ export const XEmbedOptions = object({
821
+ /**
822
+ * The tweet ID to embed.
823
+ * @example '1754336034228171055'
824
+ * @see https://developer.x.com/en/docs/twitter-for-websites/embedded-tweets/overview
825
+ */
826
+ tweetId: string(),
827
+ /**
828
+ * Optional: Custom API endpoint for fetching tweet data.
829
+ * @default '/api/_scripts/x-embed'
830
+ */
831
+ apiEndpoint: optional(string()),
832
+ /**
833
+ * Optional: Custom image proxy endpoint.
834
+ * @default '/api/_scripts/x-embed-image'
835
+ */
836
+ imageProxyEndpoint: optional(string())
837
+ });
838
+ export const VercelAnalyticsOptions = object({
839
+ /**
840
+ * The DSN of the project to send events to.
841
+ * Only required when self-hosting or deploying outside of Vercel.
842
+ */
843
+ dsn: optional(string()),
844
+ /**
845
+ * Whether to disable automatic page view tracking on route changes.
846
+ * Set to true if you want to manually call pageview().
847
+ */
848
+ disableAutoTrack: optional(boolean()),
849
+ /**
850
+ * The mode to use for the analytics script.
851
+ * - `auto` - Automatically detect the environment (default)
852
+ * - `production` - Always use production script
853
+ * - `development` - Always use development script (logs to console)
854
+ */
855
+ mode: optional(union([literal("auto"), literal("development"), literal("production")])),
856
+ /**
857
+ * Whether to enable debug logging.
858
+ * Automatically enabled in development/test environments.
859
+ */
860
+ debug: optional(boolean()),
861
+ /**
862
+ * Custom endpoint for data collection.
863
+ * Useful for self-hosted or proxied setups.
864
+ */
865
+ endpoint: optional(string())
866
+ });
867
+ export const XPixelOptions = object({
868
+ /**
869
+ * Your X (Twitter) Pixel ID.
870
+ * @see https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html
871
+ */
872
+ id: string(),
873
+ /**
874
+ * The X Pixel script version.
875
+ * @default '1.1'
876
+ */
877
+ version: optional(string())
878
+ });
879
+ export const GravatarOptions = object({
880
+ /**
881
+ * Cache duration for proxied avatar images in seconds.
882
+ * @default 3600
883
+ */
884
+ cacheMaxAge: optional(number()),
885
+ /**
886
+ * Default image to show when no Gravatar exists.
887
+ * @see https://docs.gravatar.com/general/images/#default-image
888
+ * @default 'mp'
889
+ */
890
+ default: optional(string()),
891
+ /**
892
+ * Avatar size in pixels (1-2048).
893
+ * @default 80
894
+ */
895
+ size: optional(number()),
896
+ /**
897
+ * Content rating filter.
898
+ * @default 'g'
899
+ */
900
+ rating: optional(string())
901
+ });