Skip to main content
Version 2.x of the browser JavaScript SDK, retell-client-js-sdk, will be deprecated on September 30, 2026. Upgrade to SDK 3.x and replace RetellWebClient with RetellClient for call creation, audio, and event handling. Existing integrations continue working during migration.

Upgrade the browser SDK

Upgrade to the latest browser SDK:
SDK 3.x retains RetellWebClient for compatibility. Upgrading the package alone does not migrate your integration to RetellClient; update call creation and event handlers as shown below.

Replace call creation and connection

Replace the request to your server and RetellWebClient.startCall() with RetellClient.createWebCall(). The SDK sends the v3 request and connects audio automatically. Create a public key and allow your website’s domain (localhost for local testing). Keep API keys on your server. If reCAPTCHA is enabled for the public key, pass a fresh token as recaptchaToken with each call. Add call controls to your page:
In your frontend JavaScript, replace the public key and agent ID with your own. Load this code after the buttons exist, using your frontend’s module bundler.
app.js
Serve the page over HTTPS or on localhost, click Start call, and allow microphone access. Talk to the agent, then click End call. The session ends and fires onEnd. See the web call guide for audio controls and live transcripts.

Update event handlers

Calls created through v3 do not deliver every event from the previous connection type. Audit handlers as well as call creation: See the web call guide for supported hooks, transcript authentication, and audio options. As part of this migration, POST /v2/create-web-call will also be deprecated on September 30, 2026 in favor of POST /v3/create-web-call. RetellClient.createWebCall() uses v3 automatically. If you retain an existing server-created call flow, upgrade both your server SDK and browser SDK. The server SDK’s web-call creation method now uses v3 and returns connection details instead of the full call object. If you make HTTP requests directly, switch to POST /v3/create-web-call with the same JSON body. Upgrade the browser SDK before switching the server to v3. For an existing RetellWebClient integration on SDK 3.x, forward these fields to startCall(): Use get call if your application needs call fields such as call_status, agent_id, or metadata after creation.