mc_53412
10/14/2025, 9:58 PMAI Evy
10/14/2025, 9:58 PMAI Evy
10/14/2025, 9:58 PMAI Evy
10/14/2025, 9:58 PM<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>
The widget uses the Retell public key system, allowing direct API calls from the frontend with no backend proxy required . Once embedded, the chat widget will provide text-based conversations through a chat interface .
You can also create a public key in your Retell AI Dashboard by clicking on "Keys" in the left menu, then "+ Add Key" and selecting "Public Key" [(3) ]() . Input the name of the key and the site domain you'll be embedding the widget on .AI Evy
10/14/2025, 9:58 PMmc_53412
10/14/2025, 10:02 PMAI Evy
10/14/2025, 10:02 PMAI Evy
10/14/2025, 10:03 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
[(2) ]()
This will return an agent object that includes a version field .
You can also get all versions of an agent:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponses = await client.agent.getVersions('16b980523634a6dc504898cda492e939') ;
console.log(agentResponses) ;
[(3) ]()
## Version Number Usage
The version number can be used as a parameter in API calls like get_agent or when creating calls [(1) ]() . If you don't specify a version number, the Retell SDK will default to the latest version of the agent .
For example:
get_agent(version=2) ///# Gets the version with version number 2.
get_agent() ///# Gets the latest version of the agent.AI Evy
10/14/2025, 10:03 PMAI Evy
10/14/2025, 10:03 PMmc_53412
10/14/2025, 10:05 PMAI Evy
10/14/2025, 10:05 PMAI Evy
10/14/2025, 10:06 PMAI Evy
10/14/2025, 10:06 PMAI Evy
10/14/2025, 10:06 PMmc_53412
10/14/2025, 10:07 PMAI Evy
10/14/2025, 10:07 PMAI Evy
10/14/2025, 10:07 PMhtml
<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"
></script>AI Evy
10/14/2025, 10:07 PMAI Evy
10/14/2025, 10:07 PMmc_53412
10/14/2025, 10:14 PMAI Evy
10/14/2025, 10:14 PMAI Evy
10/14/2025, 10:14 PMclient.agent.getVersions() [(1) ]()
- Listing all agents using client.agent.list() [(2) ]()
- Updating agents using client.agent.update() [(3) ]()
- Retrieving specific agents using client.agent.retrieve() [(4) ]()
These are backend API operations for agent management, not frontend chat widget implementation or troubleshooting.
For chat widget support and troubleshooting, you would need to:
Visit [Contact Sales]() or [)
Would you like me to provide a general answer about troubleshooting web widgets instead?AI Evy
10/14/2025, 10:14 PMAI Evy
10/14/2025, 10:14 PM