After identifyUser, the SDK persists identity in browser storage using a simplified model introduced in @scenaro/sdk@0.1.1.

Storage keys

KeyContent
scenaro_session:app:{applicationId}Source of truth — JSON blob { user_token, user_id, application_id, external_id }
scenaro_scenario_uuidPointer to the active publication UUID (for token refresh context)
Example after identify:
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) into scenaro_session:app:{id} and deletes obsolete keys. Legacy platform-spa keys (user_token, external_id) are still supported once via fallback.

Custom storage

Inject a StorageAdapter for SSR, tests, or non-browser environments:
Default: localStorage in browser, null on server.

Multi-embed prefix

For multiple Scenaro embeds on one origin, use storagePrefix:

Reading stored values

Clear session