diff --git a/packages/keychain/src/pages/index.tsx b/packages/keychain/src/pages/index.tsx index 02ffa47cb..c2106386d 100644 --- a/packages/keychain/src/pages/index.tsx +++ b/packages/keychain/src/pages/index.tsx @@ -18,7 +18,10 @@ function Home() { const posthog = usePostHog(); useEffect(() => { - if (context?.origin && !context.origin.includes("localhost")) { + if ( + typeof window !== "undefined" && + !window.location.hostname.includes("localhost") + ) { posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, { api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST, person_profiles: "always",