feat: add posthog reverse proxy (#449)

This commit is contained in:
David Nguyen
2023-09-28 12:56:53 +10:00
committed by GitHub
parent cdb71c3a62
commit 2eed0ae063
3 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,5 @@
import { APP_BASE_URL } from './app';
/**
* The flag name for global session recording feature flag.
*/
@ -23,7 +25,7 @@ export const LOCAL_FEATURE_FLAGS: Record<string, boolean> = {
*/
export function extractPostHogConfig(): { key: string; host: string } | null {
const postHogKey = process.env.NEXT_PUBLIC_POSTHOG_KEY;
const postHogHost = process.env.NEXT_PUBLIC_POSTHOG_HOST;
const postHogHost = `${APP_BASE_URL}/ingest`;
if (!postHogKey || !postHogHost) {
return null;