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

Function handlePosthogId

apps/web/components/PostHogUser.tsx:23–40  ·  view source on GitHub ↗
(router: NextRouter)

Source from the content-addressed store, hash-verified

21}
22
23export function handlePosthogId(router: NextRouter) {
24 if (router.query.phId) {
25 // TODO: cross match between SSR and client metrics
26 // const distinctId = (window as any)?.posthog?.get_distinct_id();
27 // distinctId &&
28 // (window as any)?.posthog?.alias({
29 // distinctId,
30 // alias: router.query.phId,
31 // });
32 const search = new URL(window.location.toString()).searchParams;
33 search.delete('phId');
34 router.replace(
35 { pathname: window.location.pathname, query: search.toString() },
36 undefined,
37 { shallow: true }
38 );
39 }
40}

Callers 1

AppFunction · 0.90

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected