- Vendored
src/lib/scenaro-sdk/folder → published@scenaro/sdkpackage - Pre-0.3 API (
useScenarioSession+AgentListener) →useScenaroSession
Before and after
| Vendored | @scenaro/sdk 0.1–0.2 | @scenaro/sdk 0.3 |
|---|---|---|
ScenarioPlayer monolith | useScenarioSession + AgentListener + RoomContext | useScenaroSession (all-in-one) |
generateToken() one-shot | identifyUser() + startSession() | Handled by start() |
window.__ event bus | useScenaroEvents() scoped bus | useScenaroEvents() (unchanged) |
| Copied protocol files | @scenaro/sdk/protocol | @scenaro/sdk/protocol (unchanged) |
| 8 divergent copies | One npm package | One npm package |
Migration steps
1
Install the package
2
Replace API client
3
Replace provider
4
Replace the session hook
5
Remove AgentListener and RoomContext wiring
useScenaroSession handles the data channel, config handshake, tool RPC, and RoomContext
injection internally. Delete these from your components:6
Update auth calls
Remove any
generateToken usage. The hook runs identify + session start automatically
on start().7
Update event listeners
8
Remove vendored copies
Delete duplicated
AgentListener, protocol/, and auth/ files. Keep only feature
components and your registry.Pre-0.3 API mapping (historical)
These exports were removed in 0.3.0. If you still import them, upgrade to 0.3.Removed (useScenarioSession) | Replacement (useScenaroSession) |
|---|---|
connect({ language }) | start() — pass language as a hook option |
disconnect() | end() |
isConnected / isConnecting | status ('connected', 'connecting', …) |
error (string) | error (ScenaroError with code) |
<AgentListener /> | Built in — remove it |
RoomContext.Provider | Built in — remove it |
useConversationMessages() | messages from the hook |
room | room (advanced only — see Transport extensions) |
runtimeConfig | rawConfig from the hook |
What to keep locally
| Keep in your app | Provided by @scenaro/sdk |
|---|---|
| Feature components | ScenaroProvider |
| Feature registry / local FeatureManager | useScenaroSession |
| Brand CSS | Data channel + session tool RPC |
| Collection API clients | Protocol types |
| Product templates | Session storage |
Storage migration
Since@scenaro/sdk@0.1.1, legacy storage keys are migrated automatically on read. No manual
migration needed for users with existing sessions.