@scenaro/sdk.
It follows the same structure as Retell, Vapi, and ElevenLabs docs: install → connect → listen →
handle tools → ship.
Already have a working quickstart? Use this page as a checklist and jump to the sections you need.
What you are building
| Layer | Your responsibility | Provided by Scenaro |
|---|---|---|
| Scenario | Choose publication UUID | Cockpit authoring + agent |
| Session | Call start() / end() | Identify, JWT, Transport credentials |
| Transport | Usually nothing | SDK connects the session + data channel — see Transport |
| Tools | Implement frontend handlers | Agent calls tools via RPC |
| UI features | Registry + components | FeatureProvider or local runtime |
| Brand | CSS, layout, copy | — |
Prerequisites
- A published scenario UUID from Cockpit
- Node.js 18+ and React 18+ (for the React path)
- Microphone access in the browser (for voice mode)
Step 1 — Install
@scenaro/sdk@0.3.0
This is all you need for the embed path below. Only install
livekit-client and
@livekit/components-react if you reach Step 7.Step 2 — Choose your integration path
React embed (recommended)
ScenaroProvider + useScenaroSession. Used by all Scenaro experience apps and platform-spa.
Start here unless you have a strong reason not to.Headless / non-React
ScenaroSession from @scenaro/sdk. Same lifecycle and events, no React bindings.
See ScenaroSession reference.Provider stack (React)
FeatureProvider is optional — skip it if you only need session tools (see Tools and features).
Step 3 — Start a session
The SDK handles the full connect flow: identify visitor → start session → connect Transport → config handshake.Auth is two-hop:
identifyUser then startSession. You never call these directly in a
typical embed — start() runs both. See Authentication.Step 4 — Listen to events
Like Retell’scall_started / Vapi’s call-start / ElevenLabs’ onConnect, Scenaro exposes
session state through the hook and typed callbacks:
| What you need | How |
|---|---|
| Connection state | status, agentState |
| Transcript / messages | messages array + onMessage |
| Session config | config (curated) or rawConfig (wire format) |
| Errors | error + onError |
| Session ended | onSessionEnd |
| Cross-component events | useScenaroEvents() event bus |
Step 5 — Handle frontend tools
When the voice agent calls a tool configured for frontend execution, the SDK routes the RPC to your handler and returns the result to the agent. You have two integration patterns — pick one per tool:| Pattern | Best for | Doc |
|---|---|---|
| Session tools | Headless logic, no UI panel | useScenaroSession({ tools }) |
| Feature tools | Tool opens a UI panel (search, cart…) | FeatureProvider registry |
Step 6 — Build UI features (optional)
For rich experiences (product search, comparison, shopping list), register feature components:- Define handlers + a React component per feature type
- Register in a
Map<string, ToolRegistryEntry> - Mount
FeatureProviderwith that registry
Most Scenaro experience apps keep a local
FeatureManager instead of SDK FeatureProvider.
Both patterns work on top of useScenaroSession. See Tools and features.Step 7 — Advanced: Transport extensions (optional)
Most embeds never touch the underlying engine directly. When you need custom audio visualizers, avatars, or participant UI, useroom from the hook — the current Transport implementation’s
engine handle:
Step 8 — Ship to production
Before going live:- Env vars:
NEXT_PUBLIC_API_URL(or equivalent) points to production API - Scenario published in Cockpit production environment
- HTTPS + microphone permission UX
- Error handling for
IDENTIFY_FAILED,SESSION_START_FAILED,MIC_PERMISSION_DENIED - Session cleanup on page unload (
end())
Recommended reading order
1
Quickstart
15-minute embed — minimal working example
2
Concepts
Key concepts — scenario, auth, protocol
3
React integration
Provider stack — props, hooks, Next.js
4
Tools
Tools and features — choose the right pattern
5
Recipes
Pick a track: embed · e-commerce · multi-language
6
Reference
Compare with other platforms
| Theme | Retell | Vapi | ElevenLabs | Scenaro |
|---|---|---|---|---|
| Web SDK install | retell-client-js-sdk | @vapi-ai/web | @elevenlabs/react | @scenaro/sdk/react |
| Start call | startCall({ accessToken }) | start(assistantId) | startSession({ agentId }) | start() via useScenaroSession |
| Auth | Server mints token | Public key + assistant ID | Signed URL / token | Two-hop identify + session (automatic) |
| Events | call_started, update | call-start, message | onConnect, onMessage | status, agentState, messages |
| Client tools | — | tool-calls (one-way) | clientTools | Session tools + FeatureProvider (two-way RPC) |
| Transport | WebRTC audio | WebRTC | WebRTC / WebSocket | Abstracted (LiveKit today) — see Transport |