@nuxt/scripts 1.0.0-beta.3 → 1.0.0-beta.31

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 (217) 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/{DdVDSbUA.js → 6CwTUC2b.js} +1 -1
  5. package/dist/client/_nuxt/{CD5B-xvT.js → B71AlSZ1.js} +1 -1
  6. package/dist/client/_nuxt/{Ds2G8aQM.js → BYGJV5dd.js} +1 -1
  7. package/dist/client/_nuxt/V4W-T8W6.js +162 -0
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/70b59a3e-a025-4a77-a25a-dfadf5b1749d.json +1 -0
  10. package/dist/client/_nuxt/entry.C5SUNdim.css +1 -0
  11. package/dist/client/_nuxt/error-404.1K8v8Su2.css +1 -0
  12. package/dist/client/_nuxt/error-500.B9qvKpQm.css +1 -0
  13. package/dist/client/index.html +1 -1
  14. package/dist/module.d.mts +6 -18
  15. package/dist/module.d.ts +164 -0
  16. package/dist/module.json +1 -1
  17. package/dist/module.mjs +908 -645
  18. package/dist/registry.d.ts +6 -0
  19. package/dist/registry.mjs +244 -78
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +16 -9
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +57 -30
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +16 -9
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +22 -39
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +69 -72
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +22 -39
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.d.vue.ts +5 -1
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +25 -38
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue.d.ts +5 -1
  29. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.d.vue.ts +43 -0
  30. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue +61 -0
  31. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue.d.ts +43 -0
  32. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +4 -0
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +22 -26
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +4 -0
  35. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +9 -5
  36. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +62 -53
  37. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +9 -5
  38. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +26 -11
  39. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +48 -45
  40. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +26 -11
  41. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +15 -4
  42. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +47 -37
  43. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +15 -4
  44. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +77 -0
  45. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +209 -0
  46. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +77 -0
  47. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +4 -0
  48. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +23 -32
  49. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +4 -0
  50. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +7 -3
  51. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +24 -38
  52. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +7 -3
  53. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +7 -3
  54. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +24 -38
  55. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +7 -3
  56. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +7 -3
  57. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +25 -38
  58. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +7 -3
  59. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +13 -0
  60. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +8 -0
  61. package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +13 -0
  62. package/dist/runtime/components/GoogleMaps/injectionKeys.js +3 -0
  63. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +26 -0
  64. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +42 -0
  65. package/dist/runtime/components/ScriptBlueskyEmbed.d.vue.ts +87 -0
  66. package/dist/runtime/components/ScriptBlueskyEmbed.vue +85 -0
  67. package/dist/runtime/components/ScriptBlueskyEmbed.vue.d.ts +87 -0
  68. package/dist/runtime/components/ScriptCrisp.vue +1 -1
  69. package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
  70. package/dist/runtime/components/ScriptGravatar.d.vue.ts +22 -0
  71. package/dist/runtime/components/ScriptGravatar.vue +46 -0
  72. package/dist/runtime/components/ScriptGravatar.vue.d.ts +22 -0
  73. package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +2 -2
  74. package/dist/runtime/components/ScriptInstagramEmbed.vue +5 -2
  75. package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +2 -2
  76. package/dist/runtime/components/ScriptIntercom.vue +4 -3
  77. package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +43 -32
  78. package/dist/runtime/components/ScriptPayPalButtons.vue +48 -79
  79. package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +43 -32
  80. package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +37 -23
  81. package/dist/runtime/components/ScriptPayPalMessages.vue +46 -50
  82. package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +37 -23
  83. package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
  84. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +9 -0
  85. package/dist/runtime/components/ScriptVimeoPlayer.vue +13 -10
  86. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +9 -0
  87. package/dist/runtime/components/ScriptXEmbed.d.vue.ts +2 -2
  88. package/dist/runtime/components/ScriptXEmbed.vue +6 -3
  89. package/dist/runtime/components/ScriptXEmbed.vue.d.ts +2 -2
  90. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +2 -2
  91. package/dist/runtime/components/ScriptYouTubePlayer.vue +11 -5
  92. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +2 -2
  93. package/dist/runtime/composables/useScript.js +13 -6
  94. package/dist/runtime/composables/useScriptEventPage.js +2 -2
  95. package/dist/runtime/composables/useScriptTriggerConsent.d.ts +10 -0
  96. package/dist/runtime/composables/useScriptTriggerConsent.js +33 -20
  97. package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
  98. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
  99. package/dist/runtime/registry/bing-uet.d.ts +20 -0
  100. package/dist/runtime/registry/bing-uet.js +29 -0
  101. package/dist/runtime/registry/bluesky-embed.d.ts +116 -0
  102. package/dist/runtime/registry/bluesky-embed.js +72 -0
  103. package/dist/runtime/registry/clarity.d.ts +10 -15
  104. package/dist/runtime/registry/clarity.js +22 -31
  105. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -13
  106. package/dist/runtime/registry/cloudflare-web-analytics.js +2 -14
  107. package/dist/runtime/registry/crisp.d.ts +10 -40
  108. package/dist/runtime/registry/crisp.js +2 -33
  109. package/dist/runtime/registry/databuddy-analytics.d.ts +2 -35
  110. package/dist/runtime/registry/databuddy-analytics.js +20 -45
  111. package/dist/runtime/registry/fathom-analytics.d.ts +7 -26
  112. package/dist/runtime/registry/fathom-analytics.js +2 -24
  113. package/dist/runtime/registry/google-adsense.d.ts +3 -11
  114. package/dist/runtime/registry/google-adsense.js +2 -11
  115. package/dist/runtime/registry/google-analytics.d.ts +3 -5
  116. package/dist/runtime/registry/google-analytics.js +3 -8
  117. package/dist/runtime/registry/google-maps.d.ts +3 -9
  118. package/dist/runtime/registry/google-maps.js +2 -8
  119. package/dist/runtime/registry/google-recaptcha.d.ts +2 -6
  120. package/dist/runtime/registry/google-recaptcha.js +4 -12
  121. package/dist/runtime/registry/google-sign-in.d.ts +2 -13
  122. package/dist/runtime/registry/google-sign-in.js +2 -22
  123. package/dist/runtime/registry/google-tag-manager.d.ts +3 -28
  124. package/dist/runtime/registry/google-tag-manager.js +4 -27
  125. package/dist/runtime/registry/gravatar.d.ts +26 -0
  126. package/dist/runtime/registry/gravatar.js +33 -0
  127. package/dist/runtime/registry/hotjar.d.ts +4 -6
  128. package/dist/runtime/registry/hotjar.js +2 -5
  129. package/dist/runtime/registry/instagram-embed.d.ts +3 -18
  130. package/dist/runtime/registry/instagram-embed.js +4 -19
  131. package/dist/runtime/registry/intercom.d.ts +4 -12
  132. package/dist/runtime/registry/intercom.js +2 -12
  133. package/dist/runtime/registry/matomo-analytics.d.ts +3 -12
  134. package/dist/runtime/registry/matomo-analytics.js +3 -12
  135. package/dist/runtime/registry/meta-pixel.d.ts +4 -6
  136. package/dist/runtime/registry/meta-pixel.js +2 -4
  137. package/dist/runtime/registry/mixpanel-analytics.d.ts +22 -0
  138. package/dist/runtime/registry/mixpanel-analytics.js +46 -0
  139. package/dist/runtime/registry/npm.d.ts +3 -7
  140. package/dist/runtime/registry/npm.js +2 -9
  141. package/dist/runtime/registry/paypal.d.ts +4 -25
  142. package/dist/runtime/registry/paypal.js +3 -66
  143. package/dist/runtime/registry/plausible-analytics.js +18 -13
  144. package/dist/runtime/registry/posthog.d.ts +10 -12
  145. package/dist/runtime/registry/posthog.js +7 -14
  146. package/dist/runtime/registry/reddit-pixel.d.ts +5 -6
  147. package/dist/runtime/registry/reddit-pixel.js +2 -4
  148. package/dist/runtime/registry/rybbit-analytics.d.ts +2 -14
  149. package/dist/runtime/registry/rybbit-analytics.js +10 -20
  150. package/dist/runtime/registry/schemas.d.ts +982 -0
  151. package/dist/runtime/registry/schemas.js +937 -0
  152. package/dist/runtime/registry/segment.d.ts +2 -5
  153. package/dist/runtime/registry/segment.js +2 -5
  154. package/dist/runtime/registry/snapchat-pixel.d.ts +4 -33
  155. package/dist/runtime/registry/snapchat-pixel.js +2 -20
  156. package/dist/runtime/registry/stripe.d.ts +3 -4
  157. package/dist/runtime/registry/stripe.js +2 -4
  158. package/dist/runtime/registry/tiktok-pixel.d.ts +4 -7
  159. package/dist/runtime/registry/tiktok-pixel.js +2 -6
  160. package/dist/runtime/registry/umami-analytics.d.ts +2 -31
  161. package/dist/runtime/registry/umami-analytics.js +2 -36
  162. package/dist/runtime/registry/vercel-analytics.d.ts +29 -0
  163. package/dist/runtime/registry/vercel-analytics.js +84 -0
  164. package/dist/runtime/registry/vimeo-player.d.ts +2 -2
  165. package/dist/runtime/registry/vimeo-player.js +1 -1
  166. package/dist/runtime/registry/x-embed.d.ts +3 -17
  167. package/dist/runtime/registry/x-embed.js +3 -18
  168. package/dist/runtime/registry/x-pixel.d.ts +4 -7
  169. package/dist/runtime/registry/x-pixel.js +2 -5
  170. package/dist/runtime/registry/youtube-player.d.ts +7 -7
  171. package/dist/runtime/registry/youtube-player.js +1 -1
  172. package/dist/runtime/server/{sw-handler.d.ts → bluesky-embed-image.d.ts} +1 -1
  173. package/dist/runtime/server/bluesky-embed-image.js +7 -0
  174. package/dist/runtime/server/bluesky-embed.d.ts +16 -0
  175. package/dist/runtime/server/bluesky-embed.js +59 -0
  176. package/dist/runtime/server/google-maps-geocode-proxy.d.ts +2 -0
  177. package/dist/runtime/server/google-maps-geocode-proxy.js +34 -0
  178. package/dist/runtime/server/google-static-maps-proxy.js +2 -13
  179. package/dist/runtime/server/gravatar-proxy.d.ts +2 -0
  180. package/dist/runtime/server/gravatar-proxy.js +46 -0
  181. package/dist/runtime/server/instagram-embed-asset.js +8 -41
  182. package/dist/runtime/server/instagram-embed-image.js +6 -53
  183. package/dist/runtime/server/instagram-embed.d.ts +16 -0
  184. package/dist/runtime/server/instagram-embed.js +173 -35
  185. package/dist/runtime/server/proxy-handler.js +144 -113
  186. package/dist/runtime/server/utils/image-proxy.d.ts +12 -0
  187. package/dist/runtime/server/utils/image-proxy.js +70 -0
  188. package/dist/runtime/server/utils/privacy.d.ts +1 -2
  189. package/dist/runtime/server/utils/privacy.js +54 -34
  190. package/dist/runtime/server/x-embed-image.js +5 -49
  191. package/dist/runtime/server/x-embed.js +3 -2
  192. package/dist/runtime/types.d.ts +74 -40
  193. package/dist/runtime/utils/pure.d.ts +1 -5
  194. package/dist/runtime/utils/pure.js +0 -67
  195. package/dist/runtime/utils.d.ts +4 -3
  196. package/dist/runtime/utils.js +24 -10
  197. package/dist/shared/scripts.D7e2ENu6.mjs +211 -0
  198. package/dist/stats.d.mts +202 -0
  199. package/dist/stats.d.ts +202 -0
  200. package/dist/stats.mjs +3860 -0
  201. package/dist/types-source.d.mts +17 -0
  202. package/dist/types-source.d.ts +17 -0
  203. package/dist/types-source.mjs +3614 -0
  204. package/package.json +52 -38
  205. package/dist/client/_nuxt/D-kOnTuH.js +0 -162
  206. package/dist/client/_nuxt/builds/meta/f1474569-6922-450d-bc3f-4fd5f3e1391a.json +0 -1
  207. package/dist/client/_nuxt/entry.D45OuV0w.css +0 -1
  208. package/dist/client/_nuxt/error-404.B57D-jUQ.css +0 -1
  209. package/dist/client/_nuxt/error-500.DTHUW7BI.css +0 -1
  210. package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +0 -52
  211. package/dist/runtime/components/ScriptPayPalMarks.vue +0 -69
  212. package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +0 -52
  213. package/dist/runtime/plugins/sw-register.client.d.ts +0 -2
  214. package/dist/runtime/plugins/sw-register.client.js +0 -12
  215. package/dist/runtime/server/sw-handler.js +0 -25
  216. package/dist/runtime/sw/proxy-sw.template.d.ts +0 -1
  217. package/dist/runtime/sw/proxy-sw.template.js +0 -54
@@ -1,53 +1,9 @@
1
- import { createError, defineEventHandler, getQuery, setHeader } from "h3";
2
- import { $fetch } from "ofetch";
3
- export default defineEventHandler(async (event) => {
4
- const query = getQuery(event);
5
- const url = query.url;
6
- if (!url) {
7
- throw createError({
8
- statusCode: 400,
9
- statusMessage: "Image URL is required"
10
- });
11
- }
12
- let parsedUrl;
13
- try {
14
- parsedUrl = new URL(url);
15
- } catch {
16
- throw createError({
17
- statusCode: 400,
18
- statusMessage: "Invalid image URL"
19
- });
20
- }
21
- if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
22
- throw createError({
23
- statusCode: 400,
24
- statusMessage: "Invalid URL scheme"
25
- });
26
- }
27
- const allowedDomains = [
1
+ import { createImageProxyHandler } from "./utils/image-proxy.js";
2
+ export default createImageProxyHandler({
3
+ allowedDomains: [
28
4
  "pbs.twimg.com",
29
5
  "abs.twimg.com",
30
6
  "video.twimg.com"
31
- ];
32
- if (!allowedDomains.includes(parsedUrl.hostname)) {
33
- throw createError({
34
- statusCode: 403,
35
- statusMessage: "Domain not allowed"
36
- });
37
- }
38
- const response = await $fetch.raw(url, {
39
- timeout: 5e3,
40
- headers: {
41
- "Accept": "image/webp,image/jpeg,image/png,image/*,*/*;q=0.8",
42
- "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
43
- }
44
- }).catch((error) => {
45
- throw createError({
46
- statusCode: error.statusCode || 500,
47
- statusMessage: error.statusMessage || "Failed to fetch image"
48
- });
49
- });
50
- setHeader(event, "Content-Type", response.headers.get("content-type") || "image/jpeg");
51
- setHeader(event, "Cache-Control", "public, max-age=3600, s-maxage=3600");
52
- return response._data;
7
+ ],
8
+ userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
53
9
  });
@@ -1,15 +1,16 @@
1
1
  import { createError, defineEventHandler, getQuery, setHeader } from "h3";
2
2
  import { $fetch } from "ofetch";
3
+ const TWEET_ID_RE = /^\d+$/;
3
4
  export default defineEventHandler(async (event) => {
4
5
  const query = getQuery(event);
5
6
  const tweetId = query.id;
6
- if (!tweetId || !/^\d+$/.test(tweetId)) {
7
+ if (!tweetId || !TWEET_ID_RE.test(tweetId)) {
7
8
  throw createError({
8
9
  statusCode: 400,
9
10
  statusMessage: "Valid Tweet ID is required"
10
11
  });
11
12
  }
12
- const randomToken = [...Array(11)].map(() => (Math.random() * 36).toString(36)[2]).join("");
13
+ const randomToken = Array.from(Array.from({ length: 11 }), () => (Math.random() * 36).toString(36)[2]).join("");
13
14
  const params = new URLSearchParams({ id: tweetId, token: randomToken });
14
15
  const tweetData = await $fetch(
15
16
  `https://cdn.syndication.twimg.com/tweet-result?${params.toString()}`,
@@ -1,37 +1,45 @@
1
+ import type { UseScriptInput, UseScriptOptions, VueScriptInstance } from '@unhead/vue';
1
2
  import type { Script } from '@unhead/vue/types';
2
- import type { UseScriptInput, VueScriptInstance, UseScriptOptions } from '@unhead/vue';
3
- import type { ComputedRef, Ref } from 'vue';
4
- import type { InferInput, ObjectSchema, ValiError } from 'valibot';
5
3
  import type { Import } from 'unimport';
6
- import type { SegmentInput } from './registry/segment.js';
4
+ import type { InferInput, ObjectSchema, UnionSchema, ValiError } from 'valibot';
5
+ import type { ComputedRef, Ref } from 'vue';
6
+ import type { BingUetInput } from './registry/bing-uet.js';
7
+ import type { BlueskyEmbedInput } from './registry/bluesky-embed.js';
8
+ import type { ClarityInput } from './registry/clarity.js';
7
9
  import type { CloudflareWebAnalyticsInput } from './registry/cloudflare-web-analytics.js';
10
+ import type { CrispInput } from './registry/crisp.js';
8
11
  import type { DatabuddyAnalyticsInput } from './registry/databuddy-analytics.js';
9
- import type { MetaPixelInput } from './registry/meta-pixel.js';
10
12
  import type { FathomAnalyticsInput } from './registry/fathom-analytics.js';
13
+ import type { GoogleAdsenseInput } from './registry/google-adsense.js';
14
+ import type { GoogleAnalyticsInput } from './registry/google-analytics.js';
15
+ import type { GoogleMapsInput } from './registry/google-maps.js';
16
+ import type { GoogleRecaptchaInput } from './registry/google-recaptcha.js';
17
+ import type { GoogleSignInInput } from './registry/google-sign-in.js';
18
+ import type { GoogleTagManagerInput } from './registry/google-tag-manager.js';
19
+ import type { GravatarInput } from './registry/gravatar.js';
11
20
  import type { HotjarInput } from './registry/hotjar.js';
21
+ import type { InstagramEmbedInput } from './registry/instagram-embed.js';
12
22
  import type { IntercomInput } from './registry/intercom.js';
13
- import type { GoogleMapsInput } from './registry/google-maps.js';
23
+ import type { LemonSqueezyInput } from './registry/lemon-squeezy.js';
14
24
  import type { MatomoAnalyticsInput } from './registry/matomo-analytics.js';
15
- import type { StripeInput } from './registry/stripe.js';
16
- import type { VimeoPlayerInput } from './registry/vimeo-player.js';
17
- import type { XPixelInput } from './registry/x-pixel.js';
18
- import type { SnapTrPixelInput } from './registry/snapchat-pixel.js';
19
- import type { YouTubePlayerInput } from './registry/youtube-player.js';
20
- import type { PlausibleAnalyticsInput } from './registry/plausible-analytics.js';
25
+ import type { MetaPixelInput } from './registry/meta-pixel.js';
26
+ import type { MixpanelAnalyticsInput } from './registry/mixpanel-analytics.js';
21
27
  import type { NpmInput } from './registry/npm.js';
22
- import type { LemonSqueezyInput } from './registry/lemon-squeezy.js';
23
- import type { GoogleAdsenseInput } from './registry/google-adsense.js';
24
- import type { ClarityInput } from './registry/clarity.js';
25
- import type { CrispInput } from './registry/crisp.js';
26
- import type { GoogleAnalyticsInput } from './registry/google-analytics.js';
27
- import type { GoogleTagManagerInput } from './registry/google-tag-manager.js';
28
- import type { UmamiAnalyticsInput } from './registry/umami-analytics.js';
29
- import type { RybbitAnalyticsInput } from './registry/rybbit-analytics.js';
30
- import type { RedditPixelInput } from './registry/reddit-pixel.js';
31
28
  import type { PayPalInput } from './registry/paypal.js';
29
+ import type { PlausibleAnalyticsInput } from './registry/plausible-analytics.js';
32
30
  import type { PostHogInput } from './registry/posthog.js';
33
- import type { GoogleRecaptchaInput } from './registry/google-recaptcha.js';
31
+ import type { RedditPixelInput } from './registry/reddit-pixel.js';
32
+ import type { RybbitAnalyticsInput } from './registry/rybbit-analytics.js';
33
+ import type { SegmentInput } from './registry/segment.js';
34
+ import type { SnapTrPixelInput } from './registry/snapchat-pixel.js';
35
+ import type { StripeInput } from './registry/stripe.js';
34
36
  import type { TikTokPixelInput } from './registry/tiktok-pixel.js';
37
+ import type { UmamiAnalyticsInput } from './registry/umami-analytics.js';
38
+ import type { VercelAnalyticsInput } from './registry/vercel-analytics.js';
39
+ import type { VimeoPlayerInput } from './registry/vimeo-player.js';
40
+ import type { XEmbedInput } from './registry/x-embed.js';
41
+ import type { XPixelInput } from './registry/x-pixel.js';
42
+ import type { YouTubePlayerInput } from './registry/youtube-player.js';
35
43
  export type WarmupStrategy = false | 'preload' | 'preconnect' | 'dns-prefetch';
36
44
  export type UseScriptContext<T extends Record<symbol | string, any>> = VueScriptInstance<T> & {
37
45
  /**
@@ -152,17 +160,22 @@ export interface NuxtDevToolsScriptInstance {
152
160
  }[];
153
161
  }
154
162
  export interface ScriptRegistry {
163
+ bingUet?: BingUetInput;
164
+ blueskyEmbed?: BlueskyEmbedInput;
165
+ carbonAds?: true;
155
166
  crisp?: CrispInput;
156
167
  clarity?: ClarityInput;
157
168
  cloudflareWebAnalytics?: CloudflareWebAnalyticsInput;
158
169
  databuddyAnalytics?: DatabuddyAnalyticsInput;
159
170
  metaPixel?: MetaPixelInput;
160
171
  fathomAnalytics?: FathomAnalyticsInput;
172
+ instagramEmbed?: InstagramEmbedInput;
161
173
  plausibleAnalytics?: PlausibleAnalyticsInput;
162
174
  googleAdsense?: GoogleAdsenseInput;
163
175
  googleAnalytics?: GoogleAnalyticsInput;
164
176
  googleMaps?: GoogleMapsInput;
165
177
  googleRecaptcha?: GoogleRecaptchaInput;
178
+ googleSignIn?: GoogleSignInInput;
166
179
  lemonSqueezy?: LemonSqueezyInput;
167
180
  googleTagManager?: GoogleTagManagerInput;
168
181
  hotjar?: HotjarInput;
@@ -170,58 +183,75 @@ export interface ScriptRegistry {
170
183
  paypal?: PayPalInput;
171
184
  posthog?: PostHogInput;
172
185
  matomoAnalytics?: MatomoAnalyticsInput;
186
+ mixpanelAnalytics?: MixpanelAnalyticsInput;
173
187
  rybbitAnalytics?: RybbitAnalyticsInput;
174
188
  redditPixel?: RedditPixelInput;
175
189
  segment?: SegmentInput;
176
190
  stripe?: StripeInput;
177
191
  tiktokPixel?: TikTokPixelInput;
192
+ xEmbed?: XEmbedInput;
178
193
  xPixel?: XPixelInput;
179
194
  snapchatPixel?: SnapTrPixelInput;
180
195
  youtubePlayer?: YouTubePlayerInput;
196
+ vercelAnalytics?: VercelAnalyticsInput;
181
197
  vimeoPlayer?: VimeoPlayerInput;
182
198
  umamiAnalytics?: UmamiAnalyticsInput;
199
+ gravatar?: GravatarInput;
200
+ npm?: NpmInput;
183
201
  [key: `${string}-npm`]: NpmInput;
184
202
  }
185
- export type NuxtConfigScriptRegistryEntry<T> = true | 'mock' | T | [T, NuxtUseScriptOptionsSerializable];
203
+ /**
204
+ * Built-in registry script keys — not affected by module augmentation.
205
+ * Use this to type-check records that must enumerate all built-in scripts (logos, meta, etc.).
206
+ */
207
+ export type BuiltInRegistryScriptKey = 'bingUet' | 'blueskyEmbed' | 'carbonAds' | 'crisp' | 'clarity' | 'cloudflareWebAnalytics' | 'databuddyAnalytics' | 'metaPixel' | 'fathomAnalytics' | 'instagramEmbed' | 'plausibleAnalytics' | 'googleAdsense' | 'googleAnalytics' | 'googleMaps' | 'googleRecaptcha' | 'googleSignIn' | 'lemonSqueezy' | 'googleTagManager' | 'hotjar' | 'intercom' | 'paypal' | 'posthog' | 'matomoAnalytics' | 'mixpanelAnalytics' | 'rybbitAnalytics' | 'redditPixel' | 'segment' | 'stripe' | 'tiktokPixel' | 'xEmbed' | 'xPixel' | 'snapchatPixel' | 'youtubePlayer' | 'vercelAnalytics' | 'vimeoPlayer' | 'umamiAnalytics' | 'gravatar' | 'npm';
208
+ /**
209
+ * Union of all explicit registry script keys (excludes npm pattern).
210
+ * Includes both built-in and augmented keys.
211
+ */
212
+ export type RegistryScriptKey = Exclude<keyof ScriptRegistry, `${string}-npm`>;
213
+ export type NuxtConfigScriptRegistryEntry<T> = true | false | 'mock' | T | [T, NuxtUseScriptOptionsSerializable];
186
214
  export type NuxtConfigScriptRegistry<T extends keyof ScriptRegistry = keyof ScriptRegistry> = Partial<{
187
215
  [key in T]: NuxtConfigScriptRegistryEntry<ScriptRegistry[key]>;
188
- }>;
216
+ }> & Record<string & {}, NuxtConfigScriptRegistryEntry<any>>;
189
217
  export type UseFunctionType<T, U> = T extends {
190
218
  use: infer V;
191
219
  } ? V extends (...args: any) => any ? ReturnType<V> : U : U;
192
220
  declare const _emptyOptions: ObjectSchema<{}, undefined>;
193
221
  export type EmptyOptionsSchema = typeof _emptyOptions;
194
222
  type ScriptInput = Script;
195
- export type InferIfSchema<T> = T extends ObjectSchema<any, any> ? InferInput<T> : T;
196
- export type RegistryScriptInput<T = EmptyOptionsSchema, Bundelable extends boolean = true, Usable extends boolean = false, CanBypassOptions extends boolean = true> = (InferIfSchema<T> & {
223
+ export type InferIfSchema<T> = T extends ObjectSchema<any, any> | UnionSchema<any, any> ? InferInput<T> : T;
224
+ export interface RegistryScriptInputExtras<Bundelable extends boolean = true, Usable extends boolean = false> {
197
225
  /**
198
226
  * A unique key to use for the script, this can be used to load multiple of the same script with different options.
199
227
  */
200
228
  key?: string;
201
229
  scriptInput?: ScriptInput;
202
230
  scriptOptions?: Omit<NuxtUseScriptOptions, Bundelable extends true ? '' : 'bundle' | Usable extends true ? '' : 'use'>;
203
- }) | Partial<InferIfSchema<T>> & (CanBypassOptions extends true ? {
231
+ }
232
+ export type RegistryScriptInput<T = EmptyOptionsSchema, Bundelable extends boolean = true, Usable extends boolean = false> = Partial<InferIfSchema<T>> & RegistryScriptInputExtras<Bundelable, Usable>;
233
+ export interface RegistryScriptServerHandler {
234
+ route: string;
235
+ handler: string;
236
+ middleware?: boolean;
237
+ }
238
+ export interface RegistryScript {
204
239
  /**
205
- * A unique key to use for the script, this can be used to load multiple of the same script with different options.
240
+ * The config key used in `scripts.registry` in nuxt.config (e.g., 'googleAnalytics', 'plausibleAnalytics').
241
+ * Used for direct lookup from config to script — avoids fragile import name convention matching.
206
242
  */
207
- key?: string;
208
- scriptInput: Required<Pick<ScriptInput, 'src'>> & ScriptInput;
209
- scriptOptions?: Omit<NuxtUseScriptOptions, Bundelable extends true ? '' : 'bundle' | Usable extends true ? '' : 'use'>;
210
- } : never);
211
- export interface RegistryScript {
243
+ registryKey?: RegistryScriptKey;
212
244
  import?: Import;
213
245
  scriptBundling?: false | ((options?: any) => string | false);
214
246
  /**
215
- * First-party routing configuration for this script.
216
- * - `string` - The proxy config key to use (e.g., 'googleAnalytics', 'metaPixel')
217
- * - `false` - Explicitly disable first-party routing for this script
218
- * - `undefined` - Use the default key derived from the function name
247
+ * First-party proxy config alias. Only needed when a script shares another script's
248
+ * proxy config (e.g., googleAdsense uses `proxy: 'googleAnalytics'`).
219
249
  *
220
- * When set to a string, the script's URLs will be rewritten and collection
221
- * endpoints will be routed through your server when `scripts.firstParty` is enabled.
250
+ * By default, the proxy config is looked up by `registryKey`. Set to `false` to
251
+ * explicitly disable first-party routing for this script.
222
252
  * @internal
223
253
  */
224
- proxy?: string | false;
254
+ proxy?: RegistryScriptKey | false;
225
255
  label?: string;
226
256
  src?: string | false;
227
257
  category?: string;
@@ -229,6 +259,10 @@ export interface RegistryScript {
229
259
  light: string;
230
260
  dark: string;
231
261
  };
262
+ /**
263
+ * Server handlers (routes/middleware) to register when this script is enabled via registry config.
264
+ */
265
+ serverHandlers?: RegistryScriptServerHandler[];
232
266
  }
233
267
  export type ElementScriptTrigger = 'immediate' | 'visible' | string | string[] | false;
234
268
  export type RegistryScripts = RegistryScript[];
@@ -4,10 +4,6 @@
4
4
  export interface ProxyRewrite {
5
5
  /** Domain and path to match (e.g., 'www.google-analytics.com/g/collect') */
6
6
  from: string;
7
- /** Local path to rewrite to (e.g., '/_scripts/c/ga/g/collect') */
7
+ /** Local path to rewrite to (e.g., '/_scripts/p/ga/g/collect') */
8
8
  to: string;
9
9
  }
10
- /**
11
- * Rewrite URLs in script content based on proxy config.
12
- */
13
- export declare function rewriteScriptUrls(content: string, rewrites: ProxyRewrite[]): string;
@@ -1,67 +0,0 @@
1
- import { parseURL, joinURL } from "ufo";
2
- export function rewriteScriptUrls(content, rewrites) {
3
- let result = content;
4
- const literalRegex = /(['"`])(.*?)\1/g;
5
- for (const { from, to } of rewrites) {
6
- const isSuffixMatch = from.startsWith(".");
7
- const fromSlashIdx = from.indexOf("/");
8
- const fromHost = fromSlashIdx > 0 ? from.slice(0, fromSlashIdx) : from;
9
- const fromPath = fromSlashIdx > 0 ? from.slice(fromSlashIdx) : "";
10
- result = result.replace(literalRegex, (match, quote, inner) => {
11
- if (!inner.includes(fromHost)) return match;
12
- const url = parseURL(inner);
13
- let shouldRewrite = false;
14
- let rewriteSuffix = "";
15
- if (url.host) {
16
- const hostMatches = isSuffixMatch ? url.host.endsWith(fromHost) : url.host === fromHost;
17
- if (hostMatches) {
18
- const fullPath = url.pathname + (url.search || "") + (url.hash || "");
19
- if (fromPath && fullPath.startsWith(fromPath)) {
20
- shouldRewrite = true;
21
- rewriteSuffix = fullPath.slice(fromPath.length);
22
- } else if (!fromPath) {
23
- shouldRewrite = true;
24
- rewriteSuffix = fullPath;
25
- }
26
- }
27
- } else if (inner.startsWith("//")) {
28
- const hostPart = inner.slice(2).split("/")[0];
29
- const hostMatches = isSuffixMatch ? hostPart?.endsWith(fromHost) ?? false : hostPart === fromHost;
30
- if (hostMatches) {
31
- const remainder = inner.slice(2 + (hostPart?.length ?? 0));
32
- if (fromPath && remainder.startsWith(fromPath)) {
33
- shouldRewrite = true;
34
- rewriteSuffix = remainder.slice(fromPath.length);
35
- } else if (!fromPath) {
36
- shouldRewrite = true;
37
- rewriteSuffix = remainder;
38
- }
39
- }
40
- } else if (fromPath && (inner.startsWith(from) || isSuffixMatch && inner.includes(from))) {
41
- const domainEnd = inner.indexOf(from) + from.length;
42
- const nextChar = inner[domainEnd];
43
- if (!nextChar || nextChar === "/" || nextChar === "?" || nextChar === "#") {
44
- shouldRewrite = true;
45
- rewriteSuffix = inner.slice(domainEnd);
46
- }
47
- }
48
- if (shouldRewrite) {
49
- const rewritten = rewriteSuffix === "/" || rewriteSuffix.startsWith("?") || rewriteSuffix.startsWith("#") ? to + rewriteSuffix : joinURL(to, rewriteSuffix);
50
- return quote + rewritten + quote;
51
- }
52
- return match;
53
- });
54
- }
55
- const gaRewrite = rewrites.find((r) => r.from.includes("google-analytics.com/g/collect"));
56
- if (gaRewrite) {
57
- result = result.replace(
58
- /"https:\/\/"\+\(.*?\)\+"\.google-analytics\.com\/g\/collect"/g,
59
- `"${gaRewrite.to}"`
60
- );
61
- result = result.replace(
62
- /"https:\/\/"\+\(.*?\)\+"\.analytics\.google\.com\/g\/collect"/g,
63
- `"${gaRewrite.to}"`
64
- );
65
- }
66
- return result;
67
- }
@@ -1,6 +1,6 @@
1
- import type { ObjectSchema } from 'valibot';
1
+ import type { EmptyOptionsSchema, InferIfSchema, NuxtUseScriptOptions, RegistryScriptInput, ScriptRegistry, UseFunctionType, UseScriptContext } from '#nuxt-scripts/types';
2
2
  import type { UseScriptInput } from '@unhead/vue';
3
- import type { EmptyOptionsSchema, InferIfSchema, NuxtUseScriptOptions, RegistryScriptInput, UseFunctionType, ScriptRegistry, UseScriptContext } from '#nuxt-scripts/types';
3
+ import type { ObjectSchema, UnionSchema } from 'valibot';
4
4
  export type MaybePromise<T> = Promise<T> | T;
5
5
  type OptionsFn<O> = (options: InferIfSchema<O>, ctx: {
6
6
  scriptInput?: UseScriptInput & {
@@ -9,10 +9,11 @@ type OptionsFn<O> = (options: InferIfSchema<O>, ctx: {
9
9
  }) => ({
10
10
  scriptInput?: UseScriptInput;
11
11
  scriptOptions?: NuxtUseScriptOptions;
12
- schema?: O extends ObjectSchema<any, any> ? O : undefined;
12
+ schema?: O extends ObjectSchema<any, any> | UnionSchema<any, any> ? O : undefined;
13
13
  clientInit?: () => void | Promise<any>;
14
14
  scriptMode?: 'external' | 'npm';
15
15
  });
16
16
  export declare function scriptRuntimeConfig<T extends keyof ScriptRegistry>(key: T): ScriptRegistry[T];
17
+ export declare function requireRegistryEndpoint(componentName: string, registryKey: string): void;
17
18
  export declare function useRegistryScript<T extends Record<string | symbol, any>, O = EmptyOptionsSchema>(registryKey: keyof ScriptRegistry | string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): UseScriptContext<UseFunctionType<NuxtUseScriptOptions<T>, T>>;
18
19
  export * from './utils/pure.js';
@@ -1,9 +1,13 @@
1
+ import { parse } from "#nuxt-scripts-validator";
1
2
  import { defu } from "defu";
2
- import { useRuntimeConfig } from "nuxt/app";
3
- import { parseURL, withQuery, parseQuery } from "ufo";
3
+ import { createError, useRuntimeConfig } from "nuxt/app";
4
+ import { parseQuery, parseURL, withQuery } from "ufo";
4
5
  import { useScript } from "./composables/useScript.js";
5
6
  import { createNpmScriptStub } from "./npm-script-stub.js";
6
- import { parse } from "#nuxt-scripts-validator";
7
+ const URL_MATCH_RE = /https?:\/\/[^/]+\/_nuxt\/(.+\.vue)(?:\?[^)]*)?:(\d+):(\d+)/;
8
+ const URL_PAREN_MATCH_RE = /\(https?:\/\/[^/]+\/_nuxt\/(.+\.vue)(?:\?[^)]*)?:(\d+):(\d+)\)/;
9
+ const VUE_MATCH_RE = /([^/\s]+\.vue):(\d+):(\d+)/;
10
+ const CLEAN_CALLER_RE = /^\s*at\s+/;
7
11
  function validateScriptInputSchema(key, schema, options) {
8
12
  if (import.meta.dev) {
9
13
  try {
@@ -17,9 +21,18 @@ function validateScriptInputSchema(key, schema, options) {
17
21
  export function scriptRuntimeConfig(key) {
18
22
  return (useRuntimeConfig().public.scripts || {})[key];
19
23
  }
24
+ export function requireRegistryEndpoint(componentName, registryKey) {
25
+ const endpoints = useRuntimeConfig().public["nuxt-scripts"]?.endpoints;
26
+ if (!endpoints?.[registryKey]) {
27
+ throw createError({
28
+ message: `${componentName} requires \`scripts.registry.${registryKey}\` to be enabled in nuxt.config`,
29
+ fatal: import.meta.dev
30
+ });
31
+ }
32
+ }
20
33
  export function useRegistryScript(registryKey, optionsFn, _userOptions) {
21
34
  const scriptConfig = scriptRuntimeConfig(registryKey);
22
- const userOptions = Object.assign(_userOptions || {}, typeof scriptConfig === "object" ? scriptConfig : {});
35
+ const userOptions = defu(_userOptions || {}, typeof scriptConfig === "object" ? scriptConfig : {});
23
36
  const options = optionsFn(userOptions, { scriptInput: userOptions.scriptInput });
24
37
  if (options.scriptMode === "npm") {
25
38
  return createNpmScriptStub({
@@ -45,7 +58,7 @@ export function useRegistryScript(registryKey, optionsFn, _userOptions) {
45
58
  };
46
59
  }
47
60
  const scriptInput = defu(finalScriptInput, userOptions.scriptInput, { key: registryKey });
48
- const scriptOptions = Object.assign(userOptions?.scriptOptions || {}, options.scriptOptions || {});
61
+ const scriptOptions = { ...userOptions?.scriptOptions, ...options.scriptOptions };
49
62
  if (import.meta.dev) {
50
63
  const error = new Error("Stack trace for component location");
51
64
  const stack = error.stack?.split("\n");
@@ -54,25 +67,26 @@ export function useRegistryScript(registryKey, optionsFn, _userOptions) {
54
67
  );
55
68
  let loadedFrom = "unknown";
56
69
  if (callerLine) {
57
- const urlMatch = callerLine.match(/https?:\/\/[^/]+\/_nuxt\/(.+\.vue)(?:\?[^)]*)?:(\d+):(\d+)/) || callerLine.match(/\(https?:\/\/[^/]+\/_nuxt\/(.+\.vue)(?:\?[^)]*)?:(\d+):(\d+)\)/);
70
+ const urlMatch = callerLine.match(URL_MATCH_RE) || callerLine.match(URL_PAREN_MATCH_RE);
58
71
  if (urlMatch) {
59
72
  const [, filePath, line, column] = urlMatch;
60
73
  loadedFrom = `./${filePath}:${line}:${column}`;
61
74
  } else {
62
- const vueMatch = callerLine.match(/([^/\s]+\.vue):(\d+):(\d+)/);
75
+ const vueMatch = callerLine.match(VUE_MATCH_RE);
63
76
  if (vueMatch) {
64
77
  const [, fileName, line, column] = vueMatch;
65
78
  loadedFrom = `./${fileName}:${line}:${column}`;
66
79
  } else {
67
- loadedFrom = callerLine.trim().replace(/^\s*at\s+/, "");
80
+ loadedFrom = callerLine.trim().replace(CLEAN_CALLER_RE, "");
68
81
  }
69
82
  }
70
83
  }
71
84
  scriptOptions.devtools = defu(scriptOptions.devtools, { registryKey, loadedFrom });
72
85
  if (options.schema) {
73
86
  const registryMeta = {};
74
- for (const k in options.schema.entries) {
75
- if (options.schema.entries[k].type !== "optional") {
87
+ const entries = "entries" in options.schema ? options.schema.entries : void 0;
88
+ for (const k in entries) {
89
+ if (entries[k]?.type !== "optional") {
76
90
  registryMeta[k] = String(userOptions[k]);
77
91
  }
78
92
  }
@@ -0,0 +1,211 @@
1
+ const FATHOM_SELF_HOSTED_RE = /\.src\.indexOf\("cdn\.usefathom\.com"\)\s*<\s*0/;
2
+ const RYBBIT_HOST_SPLIT_RE = /\w+\.split\(["']\/script\.js["']\)\[0\]/g;
3
+ const PRIVACY_NONE = { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false };
4
+ const PRIVACY_FULL = { ip: true, userAgent: true, language: true, screen: true, timezone: true, hardware: true };
5
+ const PRIVACY_HEATMAP = { ip: true, userAgent: false, language: true, screen: false, timezone: false, hardware: true };
6
+ const PRIVACY_IP_ONLY = { ip: true, userAgent: false, language: false, screen: false, timezone: false, hardware: false };
7
+ function buildProxyConfig(_proxyPrefix) {
8
+ return {
9
+ googleAnalytics: {
10
+ domains: [
11
+ "www.google-analytics.com",
12
+ "analytics.google.com",
13
+ "stats.g.doubleclick.net",
14
+ "pagead2.googlesyndication.com",
15
+ "www.googleadservices.com",
16
+ "googleads.g.doubleclick.net"
17
+ ],
18
+ privacy: PRIVACY_HEATMAP
19
+ },
20
+ googleTagManager: {
21
+ domains: ["www.googletagmanager.com"],
22
+ privacy: PRIVACY_NONE
23
+ },
24
+ metaPixel: {
25
+ domains: [
26
+ "connect.facebook.net",
27
+ "www.facebook.com",
28
+ "facebook.com",
29
+ "pixel.facebook.com"
30
+ ],
31
+ privacy: PRIVACY_FULL
32
+ },
33
+ tiktokPixel: {
34
+ domains: ["analytics.tiktok.com"],
35
+ privacy: PRIVACY_FULL
36
+ },
37
+ segment: {
38
+ domains: ["api.segment.io", "cdn.segment.com"],
39
+ privacy: PRIVACY_NONE
40
+ },
41
+ xPixel: {
42
+ domains: ["analytics.twitter.com", "static.ads-twitter.com", "t.co"],
43
+ privacy: PRIVACY_FULL
44
+ },
45
+ snapchatPixel: {
46
+ domains: ["sc-static.net", "tr.snapchat.com", "pixel.tapad.com"],
47
+ privacy: PRIVACY_FULL
48
+ },
49
+ redditPixel: {
50
+ domains: ["www.redditstatic.com", "alb.reddit.com", "pixel-config.reddit.com"],
51
+ privacy: PRIVACY_FULL
52
+ },
53
+ clarity: {
54
+ domains: [
55
+ "www.clarity.ms",
56
+ "scripts.clarity.ms",
57
+ "d.clarity.ms",
58
+ "e.clarity.ms",
59
+ "k.clarity.ms"
60
+ ],
61
+ privacy: PRIVACY_HEATMAP
62
+ },
63
+ posthog: {
64
+ domains: [
65
+ "us-assets.i.posthog.com",
66
+ "us.i.posthog.com",
67
+ "eu-assets.i.posthog.com",
68
+ "eu.i.posthog.com"
69
+ ],
70
+ privacy: PRIVACY_NONE,
71
+ autoInject: {
72
+ configField: "apiHost",
73
+ computeValue: (proxyPrefix, config) => {
74
+ const region = config.region || "us";
75
+ const host = region === "eu" ? "eu.i.posthog.com" : "us.i.posthog.com";
76
+ return `${proxyPrefix}/${host}`;
77
+ }
78
+ }
79
+ },
80
+ hotjar: {
81
+ domains: [
82
+ "static.hotjar.com",
83
+ "script.hotjar.com",
84
+ "vars.hotjar.com",
85
+ "in.hotjar.com",
86
+ "vc.hotjar.com",
87
+ "vc.hotjar.io",
88
+ "metrics.hotjar.io",
89
+ "insights.hotjar.com",
90
+ "ask.hotjar.io",
91
+ "events.hotjar.io",
92
+ "identify.hotjar.com",
93
+ "surveystats.hotjar.io"
94
+ ],
95
+ privacy: PRIVACY_HEATMAP
96
+ },
97
+ plausibleAnalytics: {
98
+ domains: ["plausible.io"],
99
+ privacy: PRIVACY_NONE,
100
+ autoInject: {
101
+ configField: "endpoint",
102
+ computeValue: (proxyPrefix) => `${proxyPrefix}/plausible.io/api/event`
103
+ }
104
+ },
105
+ cloudflareWebAnalytics: {
106
+ domains: ["static.cloudflareinsights.com", "cloudflareinsights.com"],
107
+ privacy: PRIVACY_NONE
108
+ },
109
+ rybbitAnalytics: {
110
+ domains: ["app.rybbit.io"],
111
+ privacy: PRIVACY_NONE,
112
+ autoInject: {
113
+ configField: "analyticsHost",
114
+ computeValue: (proxyPrefix) => `${proxyPrefix}/app.rybbit.io/api`
115
+ },
116
+ postProcess(output, rewrites) {
117
+ const rybbitRewrite = rewrites.find((r) => r.from === "app.rybbit.io");
118
+ if (rybbitRewrite) {
119
+ output = output.replace(
120
+ RYBBIT_HOST_SPLIT_RE,
121
+ `self.location.origin+"${rybbitRewrite.to}/api"`
122
+ );
123
+ }
124
+ return output;
125
+ }
126
+ },
127
+ umamiAnalytics: {
128
+ domains: ["cloud.umami.is", "api-gateway.umami.dev"],
129
+ privacy: PRIVACY_NONE,
130
+ autoInject: {
131
+ configField: "hostUrl",
132
+ computeValue: (proxyPrefix) => `${proxyPrefix}/cloud.umami.is`
133
+ }
134
+ },
135
+ databuddyAnalytics: {
136
+ domains: ["cdn.databuddy.cc", "basket.databuddy.cc"],
137
+ privacy: PRIVACY_NONE,
138
+ autoInject: {
139
+ configField: "apiUrl",
140
+ computeValue: (proxyPrefix) => `${proxyPrefix}/basket.databuddy.cc`
141
+ }
142
+ },
143
+ fathomAnalytics: {
144
+ domains: ["cdn.usefathom.com"],
145
+ privacy: PRIVACY_NONE,
146
+ postProcess(output) {
147
+ return output.replace(
148
+ FATHOM_SELF_HOSTED_RE,
149
+ '.src.indexOf("cdn.usefathom.com")<-1'
150
+ );
151
+ }
152
+ },
153
+ intercom: {
154
+ domains: [
155
+ "widget.intercom.io",
156
+ "api-iam.intercom.io",
157
+ "api-iam.eu.intercom.io",
158
+ "api-iam.au.intercom.io",
159
+ "js.intercomcdn.com",
160
+ "downloads.intercomcdn.com",
161
+ "video-messages.intercomcdn.com"
162
+ ],
163
+ privacy: PRIVACY_IP_ONLY
164
+ },
165
+ crisp: {
166
+ domains: [
167
+ "client.crisp.chat",
168
+ "client.relay.crisp.chat",
169
+ "assets.crisp.chat",
170
+ "go.crisp.chat",
171
+ "image.crisp.chat"
172
+ ],
173
+ privacy: PRIVACY_IP_ONLY
174
+ },
175
+ vercelAnalytics: {
176
+ domains: ["va.vercel-scripts.com"],
177
+ privacy: PRIVACY_NONE
178
+ },
179
+ gravatar: {
180
+ domains: ["secure.gravatar.com", "gravatar.com"],
181
+ privacy: PRIVACY_IP_ONLY
182
+ },
183
+ carbonAds: {
184
+ domains: ["cdn.carbonads.com"],
185
+ privacy: PRIVACY_NONE
186
+ },
187
+ lemonSqueezy: {
188
+ domains: ["assets.lemonsqueezy.com"],
189
+ privacy: PRIVACY_NONE
190
+ },
191
+ matomoAnalytics: {
192
+ domains: ["cdn.matomo.cloud"],
193
+ privacy: PRIVACY_NONE
194
+ },
195
+ // stripe, paypal: proxy: false in registry (need fingerprinting for fraud detection)
196
+ youtubePlayer: {
197
+ domains: ["www.youtube.com"],
198
+ privacy: PRIVACY_IP_ONLY
199
+ },
200
+ vimeoPlayer: {
201
+ domains: ["player.vimeo.com"],
202
+ privacy: PRIVACY_IP_ONLY
203
+ }
204
+ // googleRecaptcha, googleSignIn: proxy: false in registry (need fingerprinting for bot detection / auth)
205
+ };
206
+ }
207
+ function getAllProxyConfigs(proxyPrefix) {
208
+ return buildProxyConfig();
209
+ }
210
+
211
+ export { getAllProxyConfigs as g };