By default, Tracelit tracks anonymous sessions. If you callDocumentation Index
Fetch the complete documentation index at: https://docs.tracelit.io/llms.txt
Use this file to discover all available pages before exploring further.
identify() after a user logs in, every event from that point on (and future sessions on that device) will be linked to that user in your dashboard.

Basic usage
Callidentify() as soon as you know who the user is — after login, after an auth check, or anywhere you have access to their ID.
What happens in the dashboard
After callingidentify():
- Sessions show a user chip — click it to see all sessions for that user
- Filter the sessions list and error log by user ID or email trait
- The replay player header shows the identified user’s ID and traits
- The replay timeline shows a Identified as user_abc123 marker at the exact moment
identify()was called - Errors are linked to the user, so you can see all errors a specific person experienced
Reset on logout
Callreset() when the user logs out. This clears the stored identity so future sessions are anonymous again.
localStorage and persists across page loads. If you don’t call reset(), the next session on the same device will still be linked to the same user.
React example
Next.js App Router example
Split the init and identity concerns into two components — keeps things clean:Script tag (plain HTML)
If you’re using the script tag approach, you can callidentify() on the global __tl object — it’s safe to call before the SDK finishes loading:
Privacy notes
What data is stored?
What data is stored?
The user ID and traits you pass are stored on your Tracelit project. Nothing is inferred — Tracelit only stores exactly what you send.
Is identify() GDPR-safe?
Is identify() GDPR-safe?
Yes, as long as you treat it like any other user data. If a user requests deletion, delete their record via the Tracelit dashboard. Call
reset() client-side on logout so no future sessions are linked to them on that device.Can I send a hashed email instead of a raw email?
Can I send a hashed email instead of a raw email?
Absolutely. The
email trait is optional, and you can pass any opaque key as the user ID. A SHA-256 hashed email or a database UUID both work fine.What if I accidentally pass a sensitive key?
What if I accidentally pass a sensitive key?
In
debug mode, the SDK warns you if a trait key looks sensitive — for example, password, token, card, or ssn. These warnings appear in the browser console.Use this AI prompt
API reference
| Function | Description |
|---|---|
identify(userId, traits?) | Link the current session (and all future sessions on this device) to a user. |
reset() | Clear the stored user identity. Call on logout. |