1. Why user mapping matters
Adding user information to events helps you:- Group multiple flows (for example login retries and recovery) under the same user
- Analyze authentication behavior in a per-user view
- Connect anonymous pre-login events with known users as soon as identity is available
User references are strongly recommended because they power reliable per-user analysis in Corbado Observe.
2. User reference model
Corbado Observe supports these user reference fields:userId: Your stable internal user IDidentifier: A user-facing identifier (for example email)crossEnvironmentTransactionID: Optional correlation ID for cross-device or email-link flows
userId is recommended). Send both userId and identifier whenever available.
User reference fields are limited to
userId, identifier, and crossEnvironmentTransactionID.3. Send user references from the SDK
In the Corbado Observe SDK, user references are sent in event payloads for methods that support identity fields (for exampleflowFinished(), provideIdentifierFinished(), socialLoginFinish()).
- NPM
- CDN
Corbado Observe SDK installation and setup are explained in Getting started.
4. Best practices
- Prefer your immutable internal user ID for
userId(or a hash of it if you prefer not to expose your user IDs) - Add
identifierwhen it improves debugging or support workflows - Send the same user reference consistently across all relevant auth events
- Do not use tags for identity mapping; use tags for segmentation