Building an immersive, highly customized experience (custom audio visualizers, avatars,
multi-participant UI)? See Advanced: Transport extensions
once you’ve got the basics running here.
Prerequisites
- A published scenario UUID from Cockpit
- Node.js 18+ and a React 18+ app
- Microphone access in the browser
Step 1 — Install the SDK
Step 2 — Wrap your app
Step 3 — Start a session
useScenaroSession handles identification, session start, transport connection, and
teardown. No transport object to wire up, nothing to render conditionally around it.
What happens under the hood
1
Identify
The SDK identifies the visitor against the scenario and persists a JWT identity in
localStorage.2
Start session
A session is created for the scenario and the SDK opens a connection to the voice agent.
3
Handshake
The SDK receives the scenario’s
config (features, tools, voice stack) and registers your
frontend tool handlers automatically.4
Live
status becomes 'connected', agentState reflects what the agent is doing
('listening' | 'thinking' | 'speaking'), and messages accumulates the conversation.Reading state and handling messages
Frontend tools
Tools are plain functions — no request IDs, no manual response wrapping:external_id behavior.
Environment variables
| Variable | Example | Purpose |
|---|---|---|
VITE_SCENARO_API_URL | https://api.scenaro.io | API base URL (Vite apps) |
NEXT_PUBLIC_API_URL | https://api.scenaro.io/v1 | API base URL (Next.js — adjust apiPathPrefix) |
Next steps
- Implement an experience — full developer journey
- Tools and features — session tools vs FeatureProvider
- Feature registry — wire tool calls to UI components
- Embed voice on a website — full production recipe