Skip to content

Commit

Permalink
Use a proxy for mixpanel (#10594)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenl authored Jul 3, 2024
1 parent 06b89f4 commit 36a460f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const csp = (props: any) => {
const authHost = getAuthHost();
return [
`default-src 'self'`,
`connect-src 'self' https://api.replay.io wss://api.replay.io wss://dispatch.replay.io ws://*.replay.prod http://*.replay.prod https://telemetry.replay.io https://${authHost} https://api-js.mixpanel.com https://*.sentry.io https://*.launchdarkly.com https://*.lr-ingest.io https://*.lr-in.com https://api.stripe.com https://vitals.vercel-insights.com ${
`connect-src 'self' https://api.replay.io wss://api.replay.io wss://dispatch.replay.io ws://*.replay.prod http://*.replay.prod https://telemetry.replay.io https://${authHost} https://mixpanel-proxy.replay.io https://*.sentry.io https://*.launchdarkly.com https://*.lr-ingest.io https://*.lr-in.com https://api.stripe.com https://vitals.vercel-insights.com ${
// Required to talk to local backend in development. Enabling
// localhost:8000 for prod to support the ?dispatch parameter when running
// the local backend
Expand Down
4 changes: 3 additions & 1 deletion src/ui/utils/mixpanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ let mixpanelDisabled = true;
const enableMixpanel = () => (mixpanelDisabled = false);

export function initializeMixpanel() {
mixpanel.init("ffaeda9ef8fb976a520ca3a65bba5014");
mixpanel.init("ffaeda9ef8fb976a520ca3a65bba5014", {
api_host: "https://mixpanel-proxy.replay.io",
});

// Add the recordingId to the event metadata so we have a cookie crumb
// trail for following in other telemetry systems
Expand Down

0 comments on commit 36a460f

Please sign in to comment.