Disable PostHog in development

This commit is contained in:
chrox
2024-11-07 14:51:45 +01:00
parent 82620ac08b
commit 490038e63d
+5 -1
View File
@@ -3,7 +3,11 @@ import { ReactNode } from 'react';
import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';
if (typeof window !== 'undefined' && process.env['NEXT_PUBLIC_POSTHOG_KEY']) {
if (
typeof window !== 'undefined' &&
process.env['NODE_ENV'] === 'production' &&
process.env['NEXT_PUBLIC_POSTHOG_KEY']
) {
posthog.init(process.env['NEXT_PUBLIC_POSTHOG_KEY'], {
api_host: process.env['NEXT_PUBLIC_POSTHOG_HOST'],
person_profiles: 'always',