feat: make DISABLE_POSTHOG public (#1323)

For client side availabilty
This commit is contained in:
Thomas Camlong
2025-04-28 15:46:42 +02:00
committed by GitHub
parent 23462d2980
commit 59ad9344b7

View File

@@ -7,7 +7,7 @@ import { Suspense, useEffect } from "react"
export function PostHogProvider({ children }: { children: React.ReactNode }) { export function PostHogProvider({ children }: { children: React.ReactNode }) {
useEffect(() => { useEffect(() => {
if (process.env.DISABLE_POSTHOG === "true") return if (process.env.NEXT_PUBLIC_DISABLE_POSTHOG === "true") return
// biome-ignore lint/style/noNonNullAssertion: The NEXT_PUBLIC_POSTHOG_KEY environment variable is guaranteed to be set in production. // biome-ignore lint/style/noNonNullAssertion: The NEXT_PUBLIC_POSTHOG_KEY environment variable is guaranteed to be set in production.
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
ui_host: "https://eu.posthog.com", ui_host: "https://eu.posthog.com",