mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
use email for distinct id on cloud
This commit is contained in:
parent
7c72578765
commit
3118ec7306
1 changed files with 3 additions and 2 deletions
|
|
@ -75,12 +75,13 @@ export function PostHogProvider({ children, isDisabled, posthogApiKey }: PostHog
|
|||
|
||||
// Only identify the user if we are running in a cloud environment.
|
||||
if (env.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT !== undefined) {
|
||||
posthog.identify(session.user.id, {
|
||||
posthog.identify(session.user.email ?? session.user.id, {
|
||||
email: session.user.email,
|
||||
name: session.user.name,
|
||||
id: session.user.id,
|
||||
});
|
||||
} else {
|
||||
console.debug("PostHog identify skipped");
|
||||
posthog.identify(session.user.id);
|
||||
}
|
||||
}, [session]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue