Learn how to embed the Retell chat widget on your website
The Retell embeddable chat widget is a production-ready, customizable, and secure chat widget for websites, powered by the Retell API. The widget is embeddable via a single <script>
tag and uses the Retell public key system, allowing direct API calls from the frontend—no backend proxy required.
Create a Chat Agent
Before embedding the chat widget, you need a chat agent to handle the conversation.
For detailed instructions on creating a chat agent, refer to the Create Chat Agent guide.
Get Your Public Key and Agent ID
To embed the chat widget, you’ll need:
Add the Widget to Your Website
Add the following script tag to your HTML, within head
tag:
Replace:
YOUR_RETELL_PUBLIC_KEY
with your actual Retell public keyYOUR_RETELL_CHAT_AGENT_ID
with your actual Retell agent IDYOUR_RETELL_CHAT_AGENT_VERSION
with your agent version (optional). If left unset, the latest version will be used.YOUR_CUSTOM_TITLE
with your preferred chat window title (optional)YOUR_LOGO_URL
with the URL of your logo image (optional)YOUR_CUSTOM_COLOR
with a hex color code for the widget theme (optional, e.g., “#FFA07A”)Test the Widget
After adding the widget to your website, test it by:
The widget will automatically handle chat sessions and persist previous chats in localStorage.
Here’s a complete example of a minimal HTML page with the Retell Chat Widget:
if you don’t specify data-agent-version
, it will use the latest version of the agent.
Learn how to embed the Retell chat widget on your website
The Retell embeddable chat widget is a production-ready, customizable, and secure chat widget for websites, powered by the Retell API. The widget is embeddable via a single <script>
tag and uses the Retell public key system, allowing direct API calls from the frontend—no backend proxy required.
Create a Chat Agent
Before embedding the chat widget, you need a chat agent to handle the conversation.
For detailed instructions on creating a chat agent, refer to the Create Chat Agent guide.
Get Your Public Key and Agent ID
To embed the chat widget, you’ll need:
Add the Widget to Your Website
Add the following script tag to your HTML, within head
tag:
Replace:
YOUR_RETELL_PUBLIC_KEY
with your actual Retell public keyYOUR_RETELL_CHAT_AGENT_ID
with your actual Retell agent IDYOUR_RETELL_CHAT_AGENT_VERSION
with your agent version (optional). If left unset, the latest version will be used.YOUR_CUSTOM_TITLE
with your preferred chat window title (optional)YOUR_LOGO_URL
with the URL of your logo image (optional)YOUR_CUSTOM_COLOR
with a hex color code for the widget theme (optional, e.g., “#FFA07A”)Test the Widget
After adding the widget to your website, test it by:
The widget will automatically handle chat sessions and persist previous chats in localStorage.
Here’s a complete example of a minimal HTML page with the Retell Chat Widget:
if you don’t specify data-agent-version
, it will use the latest version of the agent.