diff --git a/apps/readest-app/src/context/PHContext.tsx b/apps/readest-app/src/context/PHContext.tsx index b6a42a08..eb2f583b 100644 --- a/apps/readest-app/src/context/PHContext.tsx +++ b/apps/readest-app/src/context/PHContext.tsx @@ -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',