bane1808
08/05/2025, 7:41 PMAI Evy
08/05/2025, 7:41 PMAI Evy
08/05/2025, 7:41 PMhead tag :
html
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
type="module"
data-public-key="YOUR_RETELL_PUBLIC_KEY"
data-agent-id="YOUR_RETELL_CHAT_AGENT_ID"
data-agent-version="YOUR_RETELL_CHAT_AGENT_VERSION"
data-title="YOUR_CUSTOM_TITLE"
data-logo-url="YOUR_LOGO_URL"
data-color="YOUR_CUSTOM_COLOR"
></script>
You'll need to replace the placeholders with your actual values :
- YOUR_RETELL_PUBLIC_KEY with your actual Retell public key
- YOUR_RETELL_CHAT_AGENT_ID with your actual Retell agent ID
- YOUR_RETELL_CHAT_AGENT_VERSION with your agent version (optional)
The widget will automatically handle chat sessions and persist previous chats in localStorage . Users can click the floating button (bottom right, robot icon) to start a conversation with your agent .
Before embedding, you'll need to:
1. Create a chat agent
2. Get your Retell Public Key and Agent ID
For detailed instructions on creating a chat agent, refer to the Create Chat Agent guide .AI Evy
08/05/2025, 7:41 PMAI Evy
08/05/2025, 7:41 PMbane1808
08/05/2025, 7:42 PMAI Evy
08/05/2025, 7:43 PMbane1808
08/05/2025, 7:43 PMAI Evy
08/05/2025, 7:43 PMAI Evy
08/05/2025, 7:43 PMAI Evy
08/05/2025, 7:43 PMAI Evy
08/05/2025, 7:43 PMbane1808
08/05/2025, 7:44 PMAI Evy
08/05/2025, 7:44 PMAI Evy
08/05/2025, 7:44 PMhtml
<script src="<https://cdn.jsdelivr.net/gh/reecesel/retell-client-js-sdk@main/dist/retell-bundle-2.0.4.min.js>"></script>
However, this approach requires backend authentication to create web calls, as you cannot reveal the API key on the frontend .
## Solution 2: Hybrid Approach - Chat Widget + Phone Integration
Since the Retell Chat Widget is specifically designed for text-based interactions [(2) ]() , you could implement a hybrid solution:
1. Use the Chat Widget for initial text interaction :
html
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
type="module"
data-public-key="YOUR_RETELL_PUBLIC_KEY"
data-agent-id="YOUR_RETELL_CHAT_AGENT_ID"
data-agent-version="0"
data-title="Chat with us!"
></script>
2. Add a separate "Call" button that initiates a phone call to your Retell AI voice agent phone number.
## Recommendation
For voice interactions from your website, I'd recommend exploring the Web SDK approach with proper backend authentication, or contact Retell AI support for the most current web voice integration options.
**AI Evy
08/05/2025, 7:44 PMAI Evy
08/05/2025, 7:44 PM