Skip to content

Commit

Permalink
🚧 update analytics tracking control with env
Browse files Browse the repository at this point in the history
  • Loading branch information
rathijitpapon committed Mar 25, 2024
1 parent b969964 commit 9b9b1ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/app/_components/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { Toaster } from "react-hot-toast"
import posthog from "posthog-js"
import { PostHogProvider } from 'posthog-js/react'

if (typeof window !== 'undefined') {
const posthog_enabled = process.env.NEXT_PUBLIC_POSTHOG_KEY != null

if (typeof window !== 'undefined' && posthog_enabled) {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY || '', {
api_host: process.env.NEXT_PUBLIC_POSTHOG_API_HOST || '',
ui_host: process.env.NEXT_PUBLIC_POSTHOG_UI_HOST || '',
Expand Down

0 comments on commit 9b9b1ba

Please sign in to comment.