Anonymous by default
On first initialization, the SDK generates a random UUID and persists it in device storage. This ID is attached to every API request and analytics event automatically. No setup required.- Swift
- Kotlin
- Flutter
- React Native
- Web
clearUserId().
Setting an identified user
CallsetUserId when the user signs in. The SDK switches all subsequent requests and events to this ID and triggers identity resolution on the backend.
- Swift
- Kotlin
- Flutter
- React Native
- Web
- Swift
- Kotlin
- Flutter
- React Native
- Web
Clearing identity
CallclearUserId on sign-out. The SDK reverts to anonymous mode with a fresh UUID. The previous anonymous ID is discarded.
- Swift
- Kotlin
- Flutter
- React Native
- Web
How identity resolution works
WhensetUserId is called, the SDK sends a POST /v1/identity/resolve request with both the anonymous ID and the identified user ID:
linked_device_ids array, and the anonymous profile is deleted. All events previously attributed to the anonymous ID become queryable under the identified user.
User ID on events
Every analytics event the SDK emits carries the current user ID in theX-User-Id request header — whether the user is anonymous or identified. You never need to attach user IDs to events manually. The SDK handles this at the network layer.