MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / PostHogUser

Function PostHogUser

apps/web/components/PostHogUser.tsx:5–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import type { NextRouter } from 'next/router';
4
5export default function PostHogUser() {
6 const session = useSession();
7
8 useEffect(() => {
9 if (
10 session.status === 'authenticated' &&
11 session.data.user?.email &&
12 (window as any).posthog?.__loaded
13 ) {
14 (window as any).posthog?.identify(session.data.user.email, {
15 email: session.data.user.email,
16 });
17 }
18 }, [session]);
19
20 return null;
21}
22
23export function handlePosthogId(router: NextRouter) {
24 if (router.query.phId) {

Callers

nothing calls this directly

Calls 1

useSessionFunction · 0.90

Tested by

no test coverage detected