Sessions are managed automatically — you don’t need to explicitly start or end them.
Reset on logout
When a user logs out, call reset() to clear all identity data and start a fresh anonymous session:
Always call reset() on logout. Without it, the next user on the same device could inherit the previous user’s identity and study history.
Offline support
The SDK queues operations locally when offline:
- Operations are persisted to local storage
- When connectivity returns, the queue drains automatically
- Operations older than 24 hours are discarded
- Duplicate operations are deduplicated
You can safely call setExternalId(), setUserProperty(), or presentStudy() even when the device is offline. The SDK processes them when the connection is restored.