https://retellai.com/?utm_source=discord&utm_medium=seo logo
how can i depoly chat and web call widget
# ❓・ai-evy-support
u
@AI Evy how can i depoly chat and web call widget ?
a
Thanks for tagging me @90iop. I'll look through relevant sources and get back to you shortly.
### Answer You can deploy both a Chat Widget and a Web Call using different methods: ## Chat Widget Add this script tag to your HTML
<head>
tag: [(1) ]()
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_CHAT_AGENT_ID"
  data-agent-version="YOUR_AGENT_VERSION"
  data-title="YOUR_CUSTOM_TITLE"
></script>
Required attributes: -
data-public-key
- Your Retell public key -
data-agent-id
- Your chat agent ID ## Web Call Widget For voice-based web calls, use the JavaScript SDK. First, install it and then start a call: [(2) ]()
Copy code
javascript
retellWebClient.startCall({
  accessToken: createCallResponse.access_token,
  sampleRate: 24000,
  captureDeviceId: "default",
  emitRawAudioSamples: false,
}) ;
You can stop the call with:
Copy code
javascript
retellWebClient.stopCall() ;
## Callback Widget (Phone-based) For a widget that collects user info and initiates phone calls, add
data-widget="callback"
and `data-phone-number`: [(1) ]()
Copy code
html
<script
  id="retell-widget"
  src="<https://dashboard.retellai.com/retell-widget.js%22>
  data-public-key="YOUR_RETELL_PUBLIC_KEY"
  data-agent-id="YOUR_VOICE_AGENT_ID"
  data-widget="callback"
  data-phone-number="YOUR_RETELL_PHONE_NUMBER"
></script>
​ To learn more, see the sources I considered: [[1] Retell Website Widget](https://docs.retellai.com/deploy/chat-widget) [[2] Connect to web call](https://docs.retellai.com/deploy/web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.