@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,318 @@
1
+ function buildProxyConfig(collectPrefix) {
2
+ return {
3
+ googleAnalytics: {
4
+ // GA4: screen/timezone/UA needed for device, time, and OS reports; rest anonymized safely
5
+ privacy: { ip: true, userAgent: false, language: true, screen: false, timezone: false, hardware: true },
6
+ rewrite: [
7
+ // Modern gtag.js uses www.google.com/g/collect
8
+ { from: "www.google.com/g/collect", to: `${collectPrefix}/ga/g/collect` },
9
+ // Older gtag.js constructs URLs dynamically: "https://"+(subdomain)+".google-analytics.com/g/collect"
10
+ // We need to catch the suffix pattern with leading dot
11
+ { from: ".google-analytics.com/g/collect", to: `${collectPrefix}/ga/g/collect` },
12
+ { from: ".analytics.google.com/g/collect", to: `${collectPrefix}/ga/g/collect` },
13
+ // Full domain patterns for static URLs
14
+ { from: "www.google-analytics.com/g/collect", to: `${collectPrefix}/ga/g/collect` },
15
+ { from: "analytics.google.com/g/collect", to: `${collectPrefix}/ga/g/collect` },
16
+ // Legacy endpoints still used by some scripts
17
+ { from: "www.google-analytics.com", to: `${collectPrefix}/ga` },
18
+ { from: "analytics.google.com", to: `${collectPrefix}/ga` },
19
+ // DoubleClick tracking (used by GA4 for ads/conversions)
20
+ { from: "stats.g.doubleclick.net/g/collect", to: `${collectPrefix}/ga/g/collect` },
21
+ { from: "stats.g.doubleclick.net", to: `${collectPrefix}/ga-dc` },
22
+ // Google Ads/Syndication tracking
23
+ { from: "pagead2.googlesyndication.com", to: `${collectPrefix}/ga-syn` },
24
+ { from: "www.googleadservices.com", to: `${collectPrefix}/ga-ads` },
25
+ { from: "googleads.g.doubleclick.net", to: `${collectPrefix}/ga-gads` }
26
+ ],
27
+ routes: {
28
+ [`${collectPrefix}/ga/**`]: { proxy: "https://www.google-analytics.com/**" },
29
+ [`${collectPrefix}/ga-dc/**`]: { proxy: "https://stats.g.doubleclick.net/**" },
30
+ [`${collectPrefix}/ga-syn/**`]: { proxy: "https://pagead2.googlesyndication.com/**" },
31
+ [`${collectPrefix}/ga-ads/**`]: { proxy: "https://www.googleadservices.com/**" },
32
+ [`${collectPrefix}/ga-gads/**`]: { proxy: "https://googleads.g.doubleclick.net/**" }
33
+ }
34
+ },
35
+ googleTagManager: {
36
+ // GTM: container only, passes data through — downstream tags have their own privacy
37
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
38
+ rewrite: [
39
+ { from: "www.googletagmanager.com", to: `${collectPrefix}/gtm` }
40
+ ],
41
+ routes: {
42
+ [`${collectPrefix}/gtm/**`]: { proxy: "https://www.googletagmanager.com/**" }
43
+ }
44
+ },
45
+ metaPixel: {
46
+ // Meta: untrusted ad network — full anonymization
47
+ privacy: { ip: true, userAgent: true, language: true, screen: true, timezone: true, hardware: true },
48
+ rewrite: [
49
+ // SDK script loading
50
+ { from: "connect.facebook.net", to: `${collectPrefix}/meta` },
51
+ // Tracking pixel endpoint (www and non-www)
52
+ { from: "www.facebook.com/tr", to: `${collectPrefix}/meta-tr` },
53
+ { from: "facebook.com/tr", to: `${collectPrefix}/meta-tr` },
54
+ // Additional Meta tracking domains
55
+ { from: "pixel.facebook.com", to: `${collectPrefix}/meta-px` },
56
+ { from: "www.facebook.com/plugins", to: `${collectPrefix}/meta-plugins` }
57
+ ],
58
+ routes: {
59
+ [`${collectPrefix}/meta/**`]: { proxy: "https://connect.facebook.net/**" },
60
+ [`${collectPrefix}/meta-tr/**`]: { proxy: "https://www.facebook.com/tr/**" },
61
+ [`${collectPrefix}/meta-px/**`]: { proxy: "https://pixel.facebook.com/**" },
62
+ [`${collectPrefix}/meta-plugins/**`]: { proxy: "https://www.facebook.com/plugins/**" }
63
+ }
64
+ },
65
+ tiktokPixel: {
66
+ // TikTok: untrusted ad network — full anonymization
67
+ privacy: { ip: true, userAgent: true, language: true, screen: true, timezone: true, hardware: true },
68
+ rewrite: [
69
+ { from: "analytics.tiktok.com", to: `${collectPrefix}/tiktok` }
70
+ ],
71
+ routes: {
72
+ [`${collectPrefix}/tiktok/**`]: { proxy: "https://analytics.tiktok.com/**" }
73
+ }
74
+ },
75
+ segment: {
76
+ // Segment: trusted data pipeline — needs maximum fidelity for downstream destinations
77
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
78
+ rewrite: [
79
+ { from: "api.segment.io", to: `${collectPrefix}/segment` },
80
+ { from: "cdn.segment.com", to: `${collectPrefix}/segment-cdn` }
81
+ ],
82
+ routes: {
83
+ [`${collectPrefix}/segment/**`]: { proxy: "https://api.segment.io/**" },
84
+ [`${collectPrefix}/segment-cdn/**`]: { proxy: "https://cdn.segment.com/**" }
85
+ }
86
+ },
87
+ xPixel: {
88
+ // X/Twitter: untrusted ad network — full anonymization
89
+ privacy: { ip: true, userAgent: true, language: true, screen: true, timezone: true, hardware: true },
90
+ rewrite: [
91
+ { from: "analytics.twitter.com", to: `${collectPrefix}/x` },
92
+ { from: "t.co", to: `${collectPrefix}/x-t` }
93
+ ],
94
+ routes: {
95
+ [`${collectPrefix}/x/**`]: { proxy: "https://analytics.twitter.com/**" },
96
+ [`${collectPrefix}/x-t/**`]: { proxy: "https://t.co/**" }
97
+ }
98
+ },
99
+ snapchatPixel: {
100
+ // Snapchat: untrusted ad network — full anonymization
101
+ privacy: { ip: true, userAgent: true, language: true, screen: true, timezone: true, hardware: true },
102
+ rewrite: [
103
+ { from: "tr.snapchat.com", to: `${collectPrefix}/snap` }
104
+ ],
105
+ routes: {
106
+ [`${collectPrefix}/snap/**`]: { proxy: "https://tr.snapchat.com/**" }
107
+ }
108
+ },
109
+ redditPixel: {
110
+ // Reddit: untrusted ad network — full anonymization
111
+ privacy: { ip: true, userAgent: true, language: true, screen: true, timezone: true, hardware: true },
112
+ rewrite: [
113
+ { from: "alb.reddit.com", to: `${collectPrefix}/reddit` },
114
+ { from: "pixel-config.reddit.com", to: `${collectPrefix}/reddit-cfg` }
115
+ ],
116
+ routes: {
117
+ [`${collectPrefix}/reddit/**`]: { proxy: "https://alb.reddit.com/**" },
118
+ [`${collectPrefix}/reddit-cfg/**`]: { proxy: "https://pixel-config.reddit.com/**" }
119
+ }
120
+ },
121
+ clarity: {
122
+ // Clarity: screen/UA/timezone needed for heatmaps and device filtering; rest anonymized
123
+ privacy: { ip: true, userAgent: false, language: true, screen: false, timezone: false, hardware: true },
124
+ rewrite: [
125
+ // Main clarity domain
126
+ { from: "www.clarity.ms", to: `${collectPrefix}/clarity` },
127
+ // Script loader (the actual SDK is loaded from here)
128
+ { from: "scripts.clarity.ms", to: `${collectPrefix}/clarity-scripts` },
129
+ // Data collection endpoint
130
+ { from: "d.clarity.ms", to: `${collectPrefix}/clarity-data` },
131
+ // Event collection endpoint
132
+ { from: "e.clarity.ms", to: `${collectPrefix}/clarity-events` },
133
+ // Collect/beacon endpoint
134
+ { from: "k.clarity.ms", to: `${collectPrefix}/clarity-collect` }
135
+ ],
136
+ routes: {
137
+ [`${collectPrefix}/clarity/**`]: { proxy: "https://www.clarity.ms/**" },
138
+ [`${collectPrefix}/clarity-scripts/**`]: { proxy: "https://scripts.clarity.ms/**" },
139
+ [`${collectPrefix}/clarity-data/**`]: { proxy: "https://d.clarity.ms/**" },
140
+ [`${collectPrefix}/clarity-events/**`]: { proxy: "https://e.clarity.ms/**" },
141
+ [`${collectPrefix}/clarity-collect/**`]: { proxy: "https://k.clarity.ms/**" }
142
+ }
143
+ },
144
+ posthog: {
145
+ // No rewrites needed - PostHog uses NPM mode, SDK URLs are set via api_host config
146
+ // PostHog: needs real IP for GeoIP enrichment + feature flag targeting
147
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
148
+ routes: {
149
+ // US region
150
+ [`${collectPrefix}/ph/static/**`]: { proxy: "https://us-assets.i.posthog.com/static/**" },
151
+ [`${collectPrefix}/ph/**`]: { proxy: "https://us.i.posthog.com/**" },
152
+ // EU region
153
+ [`${collectPrefix}/ph-eu/static/**`]: { proxy: "https://eu-assets.i.posthog.com/static/**" },
154
+ [`${collectPrefix}/ph-eu/**`]: { proxy: "https://eu.i.posthog.com/**" }
155
+ }
156
+ },
157
+ hotjar: {
158
+ // Hotjar: screen/UA/timezone needed for heatmaps and device segmentation; rest anonymized
159
+ privacy: { ip: true, userAgent: false, language: true, screen: false, timezone: false, hardware: true },
160
+ rewrite: [
161
+ // Static assets
162
+ { from: "static.hotjar.com", to: `${collectPrefix}/hotjar` },
163
+ // Script loader (bootstrap script loads the main SDK from here)
164
+ { from: "script.hotjar.com", to: `${collectPrefix}/hotjar-script` },
165
+ // Configuration/variables
166
+ { from: "vars.hotjar.com", to: `${collectPrefix}/hotjar-vars` },
167
+ // Data ingestion endpoint
168
+ { from: "in.hotjar.com", to: `${collectPrefix}/hotjar-in` },
169
+ // Video capture
170
+ { from: "vc.hotjar.com", to: `${collectPrefix}/hotjar-vc` },
171
+ // Metrics/telemetry
172
+ { from: "metrics.hotjar.io", to: `${collectPrefix}/hotjar-metrics` },
173
+ // Insights (ContentSquare integration)
174
+ { from: "insights.hotjar.com", to: `${collectPrefix}/hotjar-insights` }
175
+ ],
176
+ routes: {
177
+ [`${collectPrefix}/hotjar/**`]: { proxy: "https://static.hotjar.com/**" },
178
+ [`${collectPrefix}/hotjar-script/**`]: { proxy: "https://script.hotjar.com/**" },
179
+ [`${collectPrefix}/hotjar-vars/**`]: { proxy: "https://vars.hotjar.com/**" },
180
+ [`${collectPrefix}/hotjar-in/**`]: { proxy: "https://in.hotjar.com/**" },
181
+ [`${collectPrefix}/hotjar-vc/**`]: { proxy: "https://vc.hotjar.com/**" },
182
+ [`${collectPrefix}/hotjar-metrics/**`]: { proxy: "https://metrics.hotjar.io/**" },
183
+ [`${collectPrefix}/hotjar-insights/**`]: { proxy: "https://insights.hotjar.com/**" }
184
+ }
185
+ },
186
+ plausible: {
187
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
188
+ rewrite: [
189
+ { from: "plausible.io", to: `${collectPrefix}/plausible` }
190
+ ],
191
+ routes: {
192
+ [`${collectPrefix}/plausible/**`]: { proxy: "https://plausible.io/**" }
193
+ }
194
+ },
195
+ cloudflareWebAnalytics: {
196
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
197
+ rewrite: [
198
+ { from: "static.cloudflareinsights.com", to: `${collectPrefix}/cfwa` },
199
+ { from: "cloudflareinsights.com", to: `${collectPrefix}/cfwa-beacon` }
200
+ ],
201
+ routes: {
202
+ [`${collectPrefix}/cfwa/**`]: { proxy: "https://static.cloudflareinsights.com/**" },
203
+ [`${collectPrefix}/cfwa-beacon/**`]: { proxy: "https://cloudflareinsights.com/**" }
204
+ }
205
+ },
206
+ rybbit: {
207
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
208
+ rewrite: [
209
+ { from: "app.rybbit.io", to: `${collectPrefix}/rybbit` }
210
+ ],
211
+ routes: {
212
+ [`${collectPrefix}/rybbit/**`]: { proxy: "https://app.rybbit.io/**" }
213
+ }
214
+ },
215
+ umami: {
216
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
217
+ rewrite: [
218
+ { from: "cloud.umami.is", to: `${collectPrefix}/umami` },
219
+ { from: "api-gateway.umami.dev", to: `${collectPrefix}/umami` }
220
+ ],
221
+ routes: {
222
+ [`${collectPrefix}/umami/**`]: { proxy: "https://cloud.umami.is/**" }
223
+ }
224
+ },
225
+ databuddy: {
226
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
227
+ rewrite: [
228
+ { from: "cdn.databuddy.cc", to: `${collectPrefix}/databuddy` },
229
+ { from: "basket.databuddy.cc", to: `${collectPrefix}/databuddy-api` }
230
+ ],
231
+ routes: {
232
+ [`${collectPrefix}/databuddy/**`]: { proxy: "https://cdn.databuddy.cc/**" },
233
+ [`${collectPrefix}/databuddy-api/**`]: { proxy: "https://basket.databuddy.cc/**" }
234
+ }
235
+ },
236
+ fathom: {
237
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
238
+ rewrite: [
239
+ { from: "cdn.usefathom.com", to: `${collectPrefix}/fathom` }
240
+ ],
241
+ routes: {
242
+ [`${collectPrefix}/fathom/**`]: { proxy: "https://cdn.usefathom.com/**" }
243
+ }
244
+ },
245
+ intercom: {
246
+ privacy: { ip: true, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
247
+ rewrite: [
248
+ { from: "widget.intercom.io", to: `${collectPrefix}/intercom` },
249
+ { from: "api-iam.intercom.io", to: `${collectPrefix}/intercom-api` },
250
+ { from: "api-iam.eu.intercom.io", to: `${collectPrefix}/intercom-api-eu` },
251
+ { from: "api-iam.au.intercom.io", to: `${collectPrefix}/intercom-api-au` },
252
+ { from: "js.intercomcdn.com", to: `${collectPrefix}/intercom-cdn` }
253
+ ],
254
+ routes: {
255
+ [`${collectPrefix}/intercom/**`]: { proxy: "https://widget.intercom.io/**" },
256
+ [`${collectPrefix}/intercom-api/**`]: { proxy: "https://api-iam.intercom.io/**" },
257
+ [`${collectPrefix}/intercom-api-eu/**`]: { proxy: "https://api-iam.eu.intercom.io/**" },
258
+ [`${collectPrefix}/intercom-api-au/**`]: { proxy: "https://api-iam.au.intercom.io/**" },
259
+ [`${collectPrefix}/intercom-cdn/**`]: { proxy: "https://js.intercomcdn.com/**" }
260
+ }
261
+ },
262
+ crisp: {
263
+ privacy: { ip: true, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
264
+ rewrite: [
265
+ { from: "client.crisp.chat", to: `${collectPrefix}/crisp` }
266
+ ],
267
+ routes: {
268
+ [`${collectPrefix}/crisp/**`]: { proxy: "https://client.crisp.chat/**" }
269
+ }
270
+ },
271
+ vercelAnalytics: {
272
+ // Vercel Analytics: trusted first-party analytics — minimal privacy needed
273
+ privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
274
+ rewrite: [
275
+ { from: "va.vercel-scripts.com", to: `${collectPrefix}/vercel` }
276
+ ],
277
+ routes: {
278
+ [`${collectPrefix}/vercel/**`]: { proxy: "https://va.vercel-scripts.com/**" }
279
+ }
280
+ },
281
+ gravatar: {
282
+ // Gravatar: avatar proxy — IP anonymized, rest not needed
283
+ privacy: { ip: true, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
284
+ rewrite: [
285
+ { from: "secure.gravatar.com", to: `${collectPrefix}/gravatar` },
286
+ { from: "gravatar.com/avatar", to: `${collectPrefix}/gravatar-avatar` }
287
+ ],
288
+ routes: {
289
+ [`${collectPrefix}/gravatar/**`]: { proxy: "https://secure.gravatar.com/**" },
290
+ [`${collectPrefix}/gravatar-avatar/**`]: { proxy: "https://gravatar.com/avatar/**" }
291
+ }
292
+ }
293
+ };
294
+ }
295
+ function getProxyConfig(key, collectPrefix) {
296
+ const configs = buildProxyConfig(collectPrefix);
297
+ return configs[key];
298
+ }
299
+ function getAllProxyConfigs(collectPrefix) {
300
+ return buildProxyConfig(collectPrefix);
301
+ }
302
+ const PROXY_URL_RE = /^https?:\/\/([^/]+)(\/.*)?\/\*\*$/;
303
+ const ROUTE_WILDCARD_RE = /\/\*\*$/;
304
+ function routesToInterceptRules(routes) {
305
+ const rules = [];
306
+ for (const [localPath, { proxy }] of Object.entries(routes)) {
307
+ const match = proxy.match(PROXY_URL_RE);
308
+ if (match?.[1]) {
309
+ const domain = match[1];
310
+ const pathPrefix = match[2] || "";
311
+ const target = localPath.replace(ROUTE_WILDCARD_RE, "");
312
+ rules.push({ pattern: domain, pathPrefix, target });
313
+ }
314
+ }
315
+ return rules;
316
+ }
317
+
318
+ export { getProxyConfig as a, getAllProxyConfigs as g, routesToInterceptRules as r };
@@ -0,0 +1,39 @@
1
+ type TrackedDataType = 'page-views' | 'events' | 'conversions' | 'user-identity' | 'session-replay' | 'heatmaps' | 'clicks' | 'scrolls' | 'retargeting' | 'audiences' | 'form-submissions' | 'video-engagement' | 'transactions' | 'errors' | 'tag-injection' | 'ab-testing';
2
+
3
+ interface ScriptPrivacy {
4
+ ip: boolean;
5
+ userAgent: boolean;
6
+ language: boolean;
7
+ screen: boolean;
8
+ timezone: boolean;
9
+ hardware: boolean;
10
+ }
11
+ interface ScriptSizeDetail {
12
+ url: string;
13
+ transferKb: number;
14
+ decodedKb: number;
15
+ encoding: string;
16
+ durationMs: number;
17
+ initiatorType: string;
18
+ protocol: string;
19
+ }
20
+ interface ScriptStats {
21
+ id: string;
22
+ label: string;
23
+ category: string;
24
+ scripts: ScriptSizeDetail[];
25
+ totalTransferKb: number;
26
+ totalDecodedKb: number;
27
+ trackedData: TrackedDataType[];
28
+ hasBundling: boolean;
29
+ hasProxy: boolean;
30
+ domains: string[];
31
+ endpoints: number;
32
+ privacy: ScriptPrivacy | null;
33
+ privacyLevel: 'full' | 'partial' | 'none' | 'unknown';
34
+ loadingMethod: 'cdn' | 'npm' | 'dynamic';
35
+ }
36
+ declare function getScriptStats(): Promise<ScriptStats[]>;
37
+
38
+ export { getScriptStats };
39
+ export type { ScriptPrivacy, ScriptSizeDetail, ScriptStats, TrackedDataType };
@@ -0,0 +1,39 @@
1
+ type TrackedDataType = 'page-views' | 'events' | 'conversions' | 'user-identity' | 'session-replay' | 'heatmaps' | 'clicks' | 'scrolls' | 'retargeting' | 'audiences' | 'form-submissions' | 'video-engagement' | 'transactions' | 'errors' | 'tag-injection' | 'ab-testing';
2
+
3
+ interface ScriptPrivacy {
4
+ ip: boolean;
5
+ userAgent: boolean;
6
+ language: boolean;
7
+ screen: boolean;
8
+ timezone: boolean;
9
+ hardware: boolean;
10
+ }
11
+ interface ScriptSizeDetail {
12
+ url: string;
13
+ transferKb: number;
14
+ decodedKb: number;
15
+ encoding: string;
16
+ durationMs: number;
17
+ initiatorType: string;
18
+ protocol: string;
19
+ }
20
+ interface ScriptStats {
21
+ id: string;
22
+ label: string;
23
+ category: string;
24
+ scripts: ScriptSizeDetail[];
25
+ totalTransferKb: number;
26
+ totalDecodedKb: number;
27
+ trackedData: TrackedDataType[];
28
+ hasBundling: boolean;
29
+ hasProxy: boolean;
30
+ domains: string[];
31
+ endpoints: number;
32
+ privacy: ScriptPrivacy | null;
33
+ privacyLevel: 'full' | 'partial' | 'none' | 'unknown';
34
+ loadingMethod: 'cdn' | 'npm' | 'dynamic';
35
+ }
36
+ declare function getScriptStats(): Promise<ScriptStats[]>;
37
+
38
+ export { getScriptStats };
39
+ export type { ScriptPrivacy, ScriptSizeDetail, ScriptStats, TrackedDataType };