From eb5d3bd8a524e2fbc707997a6d1ef89b18875b35 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Thu, 2 Oct 2025 21:10:39 -0400 Subject: [PATCH] Update PostHog API host and rewrite paths for proxy integration --- instrumentation-client.ts | 2 +- next.config.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/instrumentation-client.ts b/instrumentation-client.ts index e6044c0..9a3598e 100644 --- a/instrumentation-client.ts +++ b/instrumentation-client.ts @@ -1,7 +1,7 @@ import posthog from "posthog-js"; posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY as string, { - api_host: "/_ingest", + api_host: "/_proxy/ingest", ui_host: "https://us.posthog.com", defaults: "2025-05-24", capture_exceptions: true, // This enables capturing exceptions using Error Tracking, set to false if you don't want this diff --git a/next.config.ts b/next.config.ts index 89425a9..ec252b1 100644 --- a/next.config.ts +++ b/next.config.ts @@ -23,11 +23,11 @@ const nextConfig: NextConfig = { rewrites: async () => { return [ { - source: "/_ingest/static/:path*", + source: "/_proxy/ingest/static/:path*", destination: "https://us-assets.i.posthog.com/static/:path*", }, { - source: "/_ingest/:path*", + source: "/_proxy/ingest/:path*", destination: "https://us.i.posthog.com/:path*", }, ];