https://retellai.com/?utm_source=discord&utm_medium=seo logo
I need embeded code for my website so people clic...
# ❓・ai-evy-support
b
@AI Evy I need embeded code for my website so people click on "call" button and they strart talking to my agent from retell, where can I find this code?
a
Thanks for tagging me @bane1808. I'll look through relevant sources and get back to you shortly.
### Answer Retell AI provides an embeddable chat widget that you can add to your website with a single script tag [(1) ]() . The widget uses the Retell public key system, allowing direct API calls from the frontend with no backend proxy required . To embed the widget, add this script tag to your HTML within the
head
tag :
Copy code
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 .
​ To learn more, see the sources I considered: [[1] Retell Chat Widget](https://docs.retellai.com/deploy/chat-widget) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
is it only for text? can they talk to it with voice?
a
Thanks for the feedback, glad I was helpful.
b
@AI Evy is it only for text? can they talk to it with voice?
a
Thanks for the follow-up, @bane1808. I'll get back to you soon.
### Answer The Retell Chat Widget is specifically designed for text-based interactions [(1) ]() . The documentation describes it as a "chat widget" that enables users to interact with AI agents via a "modern, lightweight text UI" [(2) ]() . For voice interactions, you would need to use Retell AI's voice agents instead, which handle phone calls and voice conversations [(1) ]() . The chat widget and voice agents are separate capabilities within the Retell AI platform [(3) ]() . If you want users to have voice conversations with your agent directly from your website, you would need to implement a different solution using Retell AI's voice agent functionality rather than the chat widget.
​ To learn more, see the sources I considered: [[1] Retell Chat Widget](https://docs.retellai.com/deploy/chat-widget) [[2] Chat Widget, Custom Function Enhancement and more!](https://www.retellai.com/changelog/chat-widget-custom-function-enhancement-and-more) [[3] Retell AI Chat Agent – Real-Time Web Chat Automation Widget | Retell AI](https://www.retellai.com/blog/meet-retell-chat-agents-build-smarter-web-chats) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy come up with solution
a
Thanks for the follow-up, @bane1808. I'll get back to you soon.
### Answer Based on the available sources, here are two solutions for enabling voice interactions on your website: ## Solution 1: Web Voice Calls with Retell SDK For voice interactions directly on your website, you can use the Retell JavaScript SDK [(1) ]() . This requires a bundled version since the Retell JS SDK is designed for use with Node and can't be included directly on a website . You can include the bundled SDK via CDN :
Copy code
html
<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 :
Copy code
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. **
​ To learn more, see the sources I considered: [[1] Discord message from @fyodor2572 on 2025-01-13](https://discord.com/channels/1186424376300679209/1186462578310910112/1328177473636274327) [[2] Retell Chat Widget](https://docs.retellai.com/deploy/chat-widget) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.