dzei2234
11/25/2025, 7:02 PMAI Evy
11/25/2025, 7:02 PMAI Evy
11/25/2025, 7:02 PM<script> tag and uses the Retell public key system, allowing direct API calls from the frontend—no backend proxy required .
Prerequisites:
- Create a chat agent using the Create Chat Agent guide
- Get your Retell Public Key
- Get your chat agent ID
Setup:
Add this script tag to your HTML within the <head> 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_CHAT_AGENT_ID"
data-agent-version="YOUR_AGENT_VERSION"
data-title="YOUR_CUSTOM_TITLE"
data-logo-url="YOUR_LOGO_URL"
data-color="YOUR_CUSTOM_COLOR"
data-bot-name="YOUR_BOT_NAME"
data-popup-message="YOUR_POPUP_MESSAGE"
data-show-ai-popup="true"
data-show-ai-popup-time="5"
data-auto-open="false"
data-dynamic='{"key": "value"}'
data-recaptcha-key="YOUR_GOOGLE_RECAPTCHA_SITE_KEY"
></script>
Required attributes:
- data-public-key - Your Retell public key
- data-agent-id - Your chat agent ID
The widget displays a robot icon in the bottom right corner . When clicked, it opens a chat interface in a modal window . Chat sessions are automatically handled and persisted in localStorage .AI Evy
11/25/2025, 7:02 PMAI Evy
11/25/2025, 7:02 PM