<script> tag. Visitors can text-chat with a chat agent, talk to a voice agent in the browser, or request a phone callback. The widget calls the Retell API directly from the browser using your public key, so you don’t need a backend proxy.
The widget has two modes:
- Chat and voice widget (default): text chat, in-browser voice calls, or both in one window.
- Callback widget: collects the visitor’s name and phone number, then your voice agent calls them.

The widget with both a chat and a voice agent: visitors choose how to talk to you.
Video tutorial
Walkthrough of embedding the widget on a site and configuring its chat, voice, and callback modes.When to use it
- Support or sales on your site: a visitor types a question, or taps Voice Assistant to talk to the agent without dialing a number.
- Voice demo on a landing page: show prospects your voice agent with a one-click browser call.
- Callback requests: a visitor leaves a phone number and your agent calls them right away, for example to qualify a lead or book an appointment.
Prerequisites
- An agent for each channel you want to offer:
- Text chat needs a chat agent.
- In-browser voice calls need a voice agent.
- The callback widget needs a voice agent and a Retell phone number to call from.
- A Retell public key. If you restrict the key to specific domains, add the domain that hosts the widget.
Chat and voice widget
The default widget adds a floating button to the bottom-right corner of your page.What do visitors see when they open the widget?
It depends on which agent IDs you set:Set up the widget
Add the script tag inside your page’s<head>. Each example below is a complete page you can copy and fill in.
id="retell-widget"; the widget reads its settings from that element.
How it works
- The visitor clicks the floating button.
- If both agents are set, they pick Voice Assistant or Chat Assistant. Otherwise the widget opens the one channel you configured.
- Chat: the visitor types and the chat agent replies, with a typing indicator while a reply is pending. Chats are saved in the browser’s localStorage, so a returning visitor resumes their most recent chat.
- Voice: the visitor starts the call, allows microphone access, and talks to the voice agent over WebRTC. The visitor can mute or hang up from the call screen. If the visitor closes the window mid-call, the call keeps running and they can reopen it to hang up.

Chat view, with the agent's greeting and reply.

Voice view before the call starts. The tab bar appears when both agents are set.
Attributes
Keys and agents
At least one of
data-public-key or data-voice-public-key is required, or the widget doesn’t load.
Appearance
Behavior
The popup message doesn’t appear when
data-auto-open is true.
Security and branding
Colors
data-color is a shorthand that sets both colors at once:
- The theme color uses
data-colorif set, otherwisedata-theme-color. - The accent color uses
data-component-colorif set, otherwisedata-color.
data-color alone. To control the two colors separately, set data-theme-color and data-component-color and leave data-color out, since data-color takes priority over data-theme-color.
Embed the widget in a page section
By default the widget floats in the bottom-right corner. To place it inside your own layout instead, such as a contact section or a dedicated support page, use the embedded build. It renders the chat, voice, or callback panel directly inside a container you control, without the floating button or popup message. Put the samedata-* attributes on a container element with data-retell-widget="true", give the container a height, and load retell-widget-embed.js once:
- The container must have a
heightormin-height. With zero height, the widget is invisible and logs a warning in the browser console. - Only the first element with
data-retell-widgeton the page is mounted. - Attributes that control the floating button and popup message have no effect.
data-retell-widget="true" and your widget attributes as custom attributes on the Div Block. Then add the retell-widget-embed.js script once under Site settings > Custom code > Footer code.
Callback widget
The callback widget collects the visitor’s contact details and has your voice agent call them on the phone.
The callback request form.
Set up the callback widget
Callback attributes
Required
Optional
The appearance and branding attributes of the chat and voice widget also work here.
How the callback widget works
- The visitor clicks the floating phone button.
- They fill in first name, last name, and phone number, and accept the privacy agreement.
- If reCAPTCHA is enabled, the submission is verified.
- The widget creates a phone call from
data-phone-numberto the visitor, handled by your voice agent.
reCAPTCHA protection
Public keys are visible in your page source, so protect them from bots with Google reCAPTCHA v3. The widget supports reCAPTCHA v3 only. When enabled, the widget requests a token for each new chat, voice call, and callback request.- Load the reCAPTCHA v3 script in your page’s
<head>: - Add
data-recaptcha-key="YOUR_GOOGLE_RECAPTCHA_SITE_KEY"to the widget. - Turn on reCAPTCHA for your public key in public key settings.
Test the widget
- Load your page and click the floating button (or scroll to your container, for the embedded build).
- For chat, send a message and check that the agent replies.
- For voice, start a call, allow microphone access, and talk to the agent.
- For callback, submit the form with your own number and wait for the call.
FAQ
How do I remove the "Powered by Retell" branding?
How do I remove the "Powered by Retell" branding?
Contact Retell support for a white-label token, then add it to the widget as
data-white-label. It works for both the floating and embedded widget, in every mode.The widget doesn't show up on my site. What should I check?
The widget doesn't show up on my site. What should I check?
Open the browser console and look for a
Retell Widget error. Check that the script tag keeps id="retell-widget", that you set at least one public key, and that your public key allows your site’s domain. If you recently updated the widget settings, hard-refresh the page (Ctrl+Shift+R or Cmd+Shift+R) to clear a cached copy of the script.Can I use the widget on Wix or Webflow?
Can I use the widget on Wix or Webflow?
Yes. Paste the script tag into your site builder’s custom code setting so it loads on every page. For Webflow, you can also use the embedded build to place the widget inside a section.

