Skip to main content
A web call connects a user to your voice agent directly in the browser, using their microphone and speakers. The Retell Web SDK creates the call and connects its audio; no phone number is involved.

When to use web calls

  • Voice inside your product. Add a support agent to your help center, a sales assistant to a landing page, or voice-guided onboarding, with a UI you fully control.
  • Custom call experiences. Build call controls and audio visualizations. Enable live transcripts separately for captions or conversation flow updates.
  • Development and testing. Talk to an agent while building it. For a quick test without writing code, use the dashboard’s web call testing.
If you want a voice entry point on your website without building a frontend, embed the website widget. To reach users on their phones, see outbound calls and inbound calls. For example, an e-commerce site adds a “Talk to support” button to its order page. Clicking it starts a web call that passes the customer’s name and order ID as dynamic variables, so the agent can look up the right order.

Set up web calls

1

Install the Web SDK

2

Configure authentication

Create a public key and allow your website’s domain. Add localhost to test locally. Use the public key in your browser code; keep API keys on your server.If your public key has reCAPTCHA enabled, obtain a fresh token before each call and pass it as recaptchaToken to createWebCall().
3

Create and connect the call

Initialize RetellClient and call createWebCall() from your button’s click handler. Replace the public key and agent ID with your own values.
createWebCall() returns a session immediately with status: "connecting", then reports live and ended through onStatus. Audio may take a moment to connect after live. Once creation succeeds, call.callId identifies the call.The browser prompts for microphone permission. Serve your page over HTTPS; localhost also works during development.agent_id is the only required call option. Common optional fields:See Create Web Call for the REST request fields, and audio controls for browser audio options.
4

End the call

The agent can also end the call. Either way, the session reports ended through onStatus and fires onEnd.

Handle call events

Pass hooks when creating the call, as shown above, or register listeners on the returned session:
Reset call controls in onEnd, including when no onError fires. Use Get Call for the recorded disconnection reason.

Enable live transcripts

Live transcripts use a separate monitoring WebSocket and are off by default. With the public-key client configured above, add transcript: true:
onTranscript receives the full transcript so far and a separate array of pre-session tool calls. The SDK merges updates by each item’s stable ID. Items include spoken turns, tool calls, and flow nodes; see the transcript item spec. Transcript text can change as a turn progresses and does not mark exact speaking boundaries.
If the optional transcript connection fails, the SDK logs a console warning and the audio call continues. This failure does not fire onError. See WebSocket authentication if you create calls through your own backend.
To follow a web call from a second screen, or to let a supervisor step in, see Monitor live calls.

Control audio during the call

Mute and unmute the microphone without ending the call:
Some browsers block playback until the user interacts with the page. To resume audio, call this from a click handler:
Pass capture, playback, or visualization settings in the audio option of createWebCall(): Use onAudio snapshots to calculate a level for an orb or volume meter. They contain incoming audio, including any background sound, and are sampled for visualization rather than continuous recording.

After the call

Collect full results after the call ends:
  • Register a webhook to receive call_started, call_ended, and call_analyzed events on your server.
  • Use call.callId with the get call API to fetch the complete transcript, recording, and analysis, or review the call in session history.

Example project

The React and Node.js demo uses RetellClient with an API key kept on the Node.js backend.

FAQ

Read the error passed to onError. Check your public key’s allowed domains, the agent ID, and microphone permission. If reCAPTCHA is enabled, provide a fresh token for each call.
Browsers can block audio playback before user interaction. Start the call from a click handler, or call call.startAudioPlayback() inside one.
The user may have denied microphone permission, or the page isn’t served over HTTPS. Microphone access requires a secure context; localhost works during development.
Use retell_llm_dynamic_variables for values the agent should use in conversation. Use metadata for values you only need to look up later, such as an internal customer ID. See dynamic variables.
Yes. Web calls draw from the same concurrency pool as outbound phone calls.