fix: init posthog only when key is available.

This commit is contained in:
Darshan
2025-01-09 11:36:35 +05:30
parent 3140abc209
commit 50e821feb8
2 changed files with 3 additions and 2 deletions

View File

@@ -9,4 +9,5 @@ PUBLIC_GROWTH_ENDPOINT=
APPWRITE_DB_INIT_ID=
APPWRITE_COL_INIT_ID=
APPWRITE_API_KEY_INIT=
SENTRY_AUTH_TOKEN=
SENTRY_AUTH_TOKEN=
PUBLIC_POSTHOG_API_KEY=

View File

@@ -7,7 +7,7 @@ export const prerender = true;
export const trailingSlash = 'never';
export const load = async () => {
if (browser) {
if (browser && PUBLIC_POSTHOG_API_KEY) {
posthog.init(PUBLIC_POSTHOG_API_KEY, {
api_host: 'https://eu.i.posthog.com',
person_profiles: 'identified_only',