mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-20 04:21:23 +00:00
* feat: process request record from sentry locally * feat: added analytics for logged in users
24 lines
620 B
TypeScript
24 lines
620 B
TypeScript
import { sentry } from '../sentry/sentry'
|
|
import { posthog } from './posthog'
|
|
|
|
/**
|
|
* Identify the current user across all analytics and error tracking services.
|
|
* Call this when the user logs in or when a stored session is restored.
|
|
*/
|
|
export function identify(user: { id: string; email?: string; name?: string }) {
|
|
sentry.setUser({ id: user.id, email: user.email })
|
|
posthog.identify(user.id, {
|
|
email: user.email,
|
|
name: user.name,
|
|
})
|
|
}
|
|
|
|
/**
|
|
* Clear user identity across all services.
|
|
* Call this when the user logs out.
|
|
*/
|
|
export function resetIdentity() {
|
|
sentry.setUser(null)
|
|
posthog.reset()
|
|
}
|