Get a live voice session running on your site in about 15 minutes. This quickstart covers the embed path — a single provider, a single hook, no transport concepts to learn.
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

If your API base URL already includes /v1 (e.g. NEXT_PUBLIC_API_URL=https://api.scenaro.io/v1), pass apiPathPrefix="" to ScenaroProvider to avoid double-prefixing paths.

Step 3 — Start a session

That’s it — 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:
See Authentication for caching, token refresh, and external_id behavior.

Environment variables

VariableExamplePurpose
VITE_SCENARO_API_URLhttps://api.scenaro.ioAPI base URL (Vite apps)
NEXT_PUBLIC_API_URLhttps://api.scenaro.io/v1API base URL (Next.js — adjust apiPathPrefix)

Next steps