@nuxt/scripts 1.0.0-beta.1 → 1.0.0-beta.12
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.
- package/README.md +6 -0
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/48AF9EJD.js +1 -0
- package/dist/client/_nuxt/Bk6ed9rg.js +1 -0
- package/dist/client/_nuxt/C4Cj8gBr.js +162 -0
- package/dist/client/_nuxt/{DTDyDxvR.js → DP0kj6Xn.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/919b81d8-ed3a-4222-8a40-df0031cc3b99.json +1 -0
- package/dist/client/_nuxt/entry.D45OuV0w.css +1 -0
- package/dist/client/_nuxt/error-404.B57D-jUQ.css +1 -0
- package/dist/client/_nuxt/error-500.DTHUW7BI.css +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.d.mts +87 -2
- package/dist/module.d.ts +176 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +710 -273
- package/dist/registry.d.ts +6 -0
- package/dist/registry.mjs +42 -19
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +7 -7
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +12 -12
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +6 -6
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +1 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +5 -5
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +7 -7
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +7 -7
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +7 -7
- package/dist/runtime/components/ScriptCrisp.vue +1 -1
- package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
- package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +53 -0
- package/dist/runtime/components/ScriptInstagramEmbed.vue +38 -0
- package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +53 -0
- package/dist/runtime/components/ScriptIntercom.vue +4 -3
- package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptPayPalButtons.vue +13 -11
- package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMarks.vue +10 -8
- package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptPayPalMessages.vue +11 -9
- package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
- package/dist/runtime/components/ScriptVimeoPlayer.vue +1 -1
- package/dist/runtime/components/ScriptXEmbed.d.vue.ts +82 -0
- package/dist/runtime/components/ScriptXEmbed.vue +76 -0
- package/dist/runtime/components/ScriptXEmbed.vue.d.ts +82 -0
- package/dist/runtime/components/ScriptYouTubePlayer.vue +7 -4
- package/dist/runtime/composables/useScript.js +26 -5
- package/dist/runtime/composables/useScriptEventPage.js +2 -2
- package/dist/runtime/composables/useScriptTriggerConsent.js +1 -1
- package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
- package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
- package/dist/runtime/composables/useScriptTriggerServiceWorker.d.ts +7 -0
- package/dist/runtime/composables/useScriptTriggerServiceWorker.js +39 -0
- package/dist/runtime/registry/clarity.js +21 -25
- package/dist/runtime/registry/cloudflare-web-analytics.js +1 -1
- package/dist/runtime/registry/crisp.js +1 -1
- package/dist/runtime/registry/databuddy-analytics.js +1 -1
- package/dist/runtime/registry/fathom-analytics.js +1 -1
- package/dist/runtime/registry/google-adsense.js +1 -1
- package/dist/runtime/registry/google-analytics.js +2 -2
- package/dist/runtime/registry/google-maps.d.ts +1 -1
- package/dist/runtime/registry/google-maps.js +1 -1
- package/dist/runtime/registry/google-recaptcha.js +2 -2
- package/dist/runtime/registry/google-sign-in.js +1 -1
- package/dist/runtime/registry/google-tag-manager.d.ts +1 -1
- package/dist/runtime/registry/google-tag-manager.js +2 -2
- package/dist/runtime/registry/hotjar.js +1 -1
- package/dist/runtime/registry/instagram-embed.d.ts +23 -0
- package/dist/runtime/registry/instagram-embed.js +22 -0
- package/dist/runtime/registry/intercom.js +1 -1
- package/dist/runtime/registry/lemon-squeezy.d.ts +0 -1
- package/dist/runtime/registry/matomo-analytics.js +2 -2
- package/dist/runtime/registry/meta-pixel.js +1 -1
- package/dist/runtime/registry/npm.js +1 -1
- package/dist/runtime/registry/paypal.d.ts +1 -1
- package/dist/runtime/registry/paypal.js +2 -2
- package/dist/runtime/registry/plausible-analytics.js +15 -9
- package/dist/runtime/registry/posthog.d.ts +3 -2
- package/dist/runtime/registry/posthog.js +8 -12
- package/dist/runtime/registry/reddit-pixel.js +1 -1
- package/dist/runtime/registry/rybbit-analytics.js +5 -3
- package/dist/runtime/registry/segment.js +1 -1
- package/dist/runtime/registry/snapchat-pixel.js +1 -1
- package/dist/runtime/registry/stripe.d.ts +1 -1
- package/dist/runtime/registry/stripe.js +1 -1
- package/dist/runtime/registry/tiktok-pixel.d.ts +1 -0
- package/dist/runtime/registry/tiktok-pixel.js +2 -1
- package/dist/runtime/registry/umami-analytics.js +1 -1
- package/dist/runtime/registry/vimeo-player.d.ts +2 -2
- package/dist/runtime/registry/vimeo-player.js +1 -1
- package/dist/runtime/registry/x-embed.d.ts +77 -0
- package/dist/runtime/registry/x-embed.js +41 -0
- package/dist/runtime/registry/x-pixel.js +1 -1
- package/dist/runtime/registry/youtube-player.d.ts +7 -7
- package/dist/runtime/registry/youtube-player.js +1 -1
- package/dist/runtime/server/google-static-maps-proxy.js +1 -1
- package/dist/runtime/server/instagram-embed-asset.d.ts +2 -0
- package/dist/runtime/server/instagram-embed-asset.js +42 -0
- package/dist/runtime/server/instagram-embed-image.d.ts +2 -0
- package/dist/runtime/server/instagram-embed-image.js +54 -0
- package/dist/runtime/server/instagram-embed.d.ts +2 -0
- package/dist/runtime/server/instagram-embed.js +91 -0
- package/dist/runtime/server/proxy-handler.d.ts +6 -0
- package/dist/runtime/server/proxy-handler.js +264 -0
- package/dist/runtime/server/utils/privacy.d.ts +141 -0
- package/dist/runtime/server/utils/privacy.js +324 -0
- package/dist/runtime/server/x-embed-image.d.ts +2 -0
- package/dist/runtime/server/x-embed-image.js +53 -0
- package/dist/runtime/server/x-embed.d.ts +49 -0
- package/dist/runtime/server/x-embed.js +31 -0
- package/dist/runtime/types.d.ts +51 -22
- package/dist/runtime/utils/pure.d.ts +9 -0
- package/dist/runtime/utils/pure.js +0 -0
- package/dist/runtime/utils.d.ts +3 -3
- package/dist/runtime/utils.js +3 -2
- package/dist/shared/scripts.DLRgvHQg.mjs +288 -0
- package/dist/stats.d.mts +39 -0
- package/dist/stats.d.ts +39 -0
- package/dist/stats.mjs +711 -0
- package/dist/types.d.mts +1 -1
- package/package.json +48 -41
- package/dist/client/_nuxt/Bdf7Qtwg.js +0 -1
- package/dist/client/_nuxt/CoyZWCgl.js +0 -162
- package/dist/client/_nuxt/Ds1k3yKJ.js +0 -1
- package/dist/client/_nuxt/builds/meta/62574f80-71d4-4f9e-8b96-145c85230d99.json +0 -1
- package/dist/client/_nuxt/entry.BjfcJo5q.css +0 -1
- package/dist/client/_nuxt/error-404.D45Vtjcx.css +0 -1
- package/dist/client/_nuxt/error-500.BOm1rWQf.css +0 -1
|
@@ -0,0 +1,288 @@
|
|
|
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
|
+
],
|
|
134
|
+
routes: {
|
|
135
|
+
[`${collectPrefix}/clarity/**`]: { proxy: "https://www.clarity.ms/**" },
|
|
136
|
+
[`${collectPrefix}/clarity-scripts/**`]: { proxy: "https://scripts.clarity.ms/**" },
|
|
137
|
+
[`${collectPrefix}/clarity-data/**`]: { proxy: "https://d.clarity.ms/**" },
|
|
138
|
+
[`${collectPrefix}/clarity-events/**`]: { proxy: "https://e.clarity.ms/**" }
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
posthog: {
|
|
142
|
+
// No rewrites needed - PostHog uses NPM mode, SDK URLs are set via api_host config
|
|
143
|
+
// PostHog: needs real IP for GeoIP enrichment + feature flag targeting
|
|
144
|
+
privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
145
|
+
routes: {
|
|
146
|
+
// US region
|
|
147
|
+
[`${collectPrefix}/ph/static/**`]: { proxy: "https://us-assets.i.posthog.com/static/**" },
|
|
148
|
+
[`${collectPrefix}/ph/**`]: { proxy: "https://us.i.posthog.com/**" },
|
|
149
|
+
// EU region
|
|
150
|
+
[`${collectPrefix}/ph-eu/static/**`]: { proxy: "https://eu-assets.i.posthog.com/static/**" },
|
|
151
|
+
[`${collectPrefix}/ph-eu/**`]: { proxy: "https://eu.i.posthog.com/**" }
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
hotjar: {
|
|
155
|
+
// Hotjar: screen/UA/timezone needed for heatmaps and device segmentation; rest anonymized
|
|
156
|
+
privacy: { ip: true, userAgent: false, language: true, screen: false, timezone: false, hardware: true },
|
|
157
|
+
rewrite: [
|
|
158
|
+
// Static assets
|
|
159
|
+
{ from: "static.hotjar.com", to: `${collectPrefix}/hotjar` },
|
|
160
|
+
// Script loader (bootstrap script loads the main SDK from here)
|
|
161
|
+
{ from: "script.hotjar.com", to: `${collectPrefix}/hotjar-script` },
|
|
162
|
+
// Configuration/variables
|
|
163
|
+
{ from: "vars.hotjar.com", to: `${collectPrefix}/hotjar-vars` },
|
|
164
|
+
// Data ingestion endpoint
|
|
165
|
+
{ from: "in.hotjar.com", to: `${collectPrefix}/hotjar-in` },
|
|
166
|
+
// Video capture
|
|
167
|
+
{ from: "vc.hotjar.com", to: `${collectPrefix}/hotjar-vc` },
|
|
168
|
+
// Metrics/telemetry
|
|
169
|
+
{ from: "metrics.hotjar.io", to: `${collectPrefix}/hotjar-metrics` },
|
|
170
|
+
// Insights (ContentSquare integration)
|
|
171
|
+
{ from: "insights.hotjar.com", to: `${collectPrefix}/hotjar-insights` }
|
|
172
|
+
],
|
|
173
|
+
routes: {
|
|
174
|
+
[`${collectPrefix}/hotjar/**`]: { proxy: "https://static.hotjar.com/**" },
|
|
175
|
+
[`${collectPrefix}/hotjar-script/**`]: { proxy: "https://script.hotjar.com/**" },
|
|
176
|
+
[`${collectPrefix}/hotjar-vars/**`]: { proxy: "https://vars.hotjar.com/**" },
|
|
177
|
+
[`${collectPrefix}/hotjar-in/**`]: { proxy: "https://in.hotjar.com/**" },
|
|
178
|
+
[`${collectPrefix}/hotjar-vc/**`]: { proxy: "https://vc.hotjar.com/**" },
|
|
179
|
+
[`${collectPrefix}/hotjar-metrics/**`]: { proxy: "https://metrics.hotjar.io/**" },
|
|
180
|
+
[`${collectPrefix}/hotjar-insights/**`]: { proxy: "https://insights.hotjar.com/**" }
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
plausible: {
|
|
184
|
+
privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
185
|
+
rewrite: [
|
|
186
|
+
{ from: "plausible.io", to: `${collectPrefix}/plausible` }
|
|
187
|
+
],
|
|
188
|
+
routes: {
|
|
189
|
+
[`${collectPrefix}/plausible/**`]: { proxy: "https://plausible.io/**" }
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
cloudflareWebAnalytics: {
|
|
193
|
+
privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
194
|
+
rewrite: [
|
|
195
|
+
{ from: "static.cloudflareinsights.com", to: `${collectPrefix}/cfwa` },
|
|
196
|
+
{ from: "cloudflareinsights.com", to: `${collectPrefix}/cfwa-beacon` }
|
|
197
|
+
],
|
|
198
|
+
routes: {
|
|
199
|
+
[`${collectPrefix}/cfwa/**`]: { proxy: "https://static.cloudflareinsights.com/**" },
|
|
200
|
+
[`${collectPrefix}/cfwa-beacon/**`]: { proxy: "https://cloudflareinsights.com/**" }
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
rybbit: {
|
|
204
|
+
privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
205
|
+
rewrite: [
|
|
206
|
+
{ from: "app.rybbit.io", to: `${collectPrefix}/rybbit` }
|
|
207
|
+
],
|
|
208
|
+
routes: {
|
|
209
|
+
[`${collectPrefix}/rybbit/**`]: { proxy: "https://app.rybbit.io/**" }
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
umami: {
|
|
213
|
+
privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
214
|
+
rewrite: [
|
|
215
|
+
{ from: "cloud.umami.is", to: `${collectPrefix}/umami` }
|
|
216
|
+
],
|
|
217
|
+
routes: {
|
|
218
|
+
[`${collectPrefix}/umami/**`]: { proxy: "https://cloud.umami.is/**" }
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
databuddy: {
|
|
222
|
+
privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
223
|
+
rewrite: [
|
|
224
|
+
{ from: "cdn.databuddy.cc", to: `${collectPrefix}/databuddy` },
|
|
225
|
+
{ from: "basket.databuddy.cc", to: `${collectPrefix}/databuddy-api` }
|
|
226
|
+
],
|
|
227
|
+
routes: {
|
|
228
|
+
[`${collectPrefix}/databuddy/**`]: { proxy: "https://cdn.databuddy.cc/**" },
|
|
229
|
+
[`${collectPrefix}/databuddy-api/**`]: { proxy: "https://basket.databuddy.cc/**" }
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
fathom: {
|
|
233
|
+
privacy: { ip: false, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
234
|
+
rewrite: [
|
|
235
|
+
{ from: "cdn.usefathom.com", to: `${collectPrefix}/fathom` }
|
|
236
|
+
],
|
|
237
|
+
routes: {
|
|
238
|
+
[`${collectPrefix}/fathom/**`]: { proxy: "https://cdn.usefathom.com/**" }
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
intercom: {
|
|
242
|
+
privacy: { ip: true, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
243
|
+
rewrite: [
|
|
244
|
+
{ from: "widget.intercom.io", to: `${collectPrefix}/intercom` },
|
|
245
|
+
{ from: "api-iam.intercom.io", to: `${collectPrefix}/intercom-api` },
|
|
246
|
+
{ from: "api-iam.eu.intercom.io", to: `${collectPrefix}/intercom-api-eu` },
|
|
247
|
+
{ from: "api-iam.au.intercom.io", to: `${collectPrefix}/intercom-api-au` }
|
|
248
|
+
],
|
|
249
|
+
routes: {
|
|
250
|
+
[`${collectPrefix}/intercom/**`]: { proxy: "https://widget.intercom.io/**" },
|
|
251
|
+
[`${collectPrefix}/intercom-api/**`]: { proxy: "https://api-iam.intercom.io/**" },
|
|
252
|
+
[`${collectPrefix}/intercom-api-eu/**`]: { proxy: "https://api-iam.eu.intercom.io/**" },
|
|
253
|
+
[`${collectPrefix}/intercom-api-au/**`]: { proxy: "https://api-iam.au.intercom.io/**" }
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
crisp: {
|
|
257
|
+
privacy: { ip: true, userAgent: false, language: false, screen: false, timezone: false, hardware: false },
|
|
258
|
+
rewrite: [
|
|
259
|
+
{ from: "client.crisp.chat", to: `${collectPrefix}/crisp` }
|
|
260
|
+
],
|
|
261
|
+
routes: {
|
|
262
|
+
[`${collectPrefix}/crisp/**`]: { proxy: "https://client.crisp.chat/**" }
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function getProxyConfig(key, collectPrefix) {
|
|
268
|
+
const configs = buildProxyConfig(collectPrefix);
|
|
269
|
+
return configs[key];
|
|
270
|
+
}
|
|
271
|
+
function getAllProxyConfigs(collectPrefix) {
|
|
272
|
+
return buildProxyConfig(collectPrefix);
|
|
273
|
+
}
|
|
274
|
+
function routesToInterceptRules(routes) {
|
|
275
|
+
const rules = [];
|
|
276
|
+
for (const [localPath, { proxy }] of Object.entries(routes)) {
|
|
277
|
+
const match = proxy.match(/^https?:\/\/([^/]+)(\/.*)?\/\*\*$/);
|
|
278
|
+
if (match?.[1]) {
|
|
279
|
+
const domain = match[1];
|
|
280
|
+
const pathPrefix = match[2] || "";
|
|
281
|
+
const target = localPath.replace(/\/\*\*$/, "");
|
|
282
|
+
rules.push({ pattern: domain, pathPrefix, target });
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return rules;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export { getProxyConfig as a, getAllProxyConfigs as g, routesToInterceptRules as r };
|
package/dist/stats.d.mts
ADDED
|
@@ -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 };
|
package/dist/stats.d.ts
ADDED
|
@@ -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 };
|