identifyUser, the SDK persists identity in browser storage using a simplified model introduced in @scenaro/sdk@0.1.1.
Storage keys
| Key | Content |
|---|---|
scenaro_session:app:{applicationId} | Source of truth — JSON blob { user_token, user_id, application_id, external_id } |
scenaro_scenario_uuid | Pointer to the active publication UUID (for token refresh context) |
Transport session credentials (LiveKit tokens today) are ephemeral — they are not stored. Only the JWT identity is persisted.
Removed keys (v0.1.1+)
The following are no longer written at identify time:- Flat keys:
scenaro_user_token,scenaro_user_id,scenaro_application_id,scenaro_external_id - Duplicate scenario blob:
scenaro_session:{scenarioUUID}
Automatic migration
On read, the SDK client consolidates legacy storage formats (flat keys or scenario-scoped blobs) intoscenaro_session:app:{id} and deletes obsolete keys. Legacy platform-spa keys
(user_token, external_id) are still supported once via fallback.
Custom storage
Inject aStorageAdapter for SSR, tests, or non-browser environments:
localStorage in browser, null on server.
Multi-embed prefix
For multiple Scenaro embeds on one origin, usestoragePrefix: