From ea7ea600b2fd153ffa2707ab6b19aaddc14f2574 Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Tue, 2 Jan 2024 10:03:49 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20posthog=20(#1945)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit added reverse proxy # Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --- frontend/app/App.tsx | 4 +++- vercel.json | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/app/App.tsx b/frontend/app/App.tsx index 63d797ae2001..ce9cf0ddbc2d 100644 --- a/frontend/app/App.tsx +++ b/frontend/app/App.tsx @@ -22,7 +22,9 @@ if ( process.env.NEXT_PUBLIC_POSTHOG_HOST != null ) { posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, { - api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, + ui_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + api_host: `${process.env.NEXT_PUBLIC_FRONTEND_URL}/ingest`, opt_in_site_apps: true, disable_session_recording: true, }); diff --git a/vercel.json b/vercel.json index 8e82c51ff622..7310aac7ce1e 100644 --- a/vercel.json +++ b/vercel.json @@ -3,5 +3,11 @@ "deploymentEnabled": { "main": false } - } + }, + "rewrites": [ + { + "source": "/ingest/:path*", + "destination": "https://app.posthog.com/:path*" + } + ] } \ No newline at end of file