Embed a Voice Widget on Your Website
The Truedy embed widget lets anyone add a live AI voice call button to their website with a single<script> tag. Visitors click the button and speak directly to your Truedy AI agent in real time — no phone number, no app download, no backend required.
This guide covers the pre-built Truedy widget — the fastest way to go live. If you need full control over the UI and want to build a completely custom widget from scratch, see the Custom Voice Widget guide instead.
How it works
start widget call operation.
Step 1 — Create a widget in the dashboard
- Go to app.truedy.ai → Widgets in the sidebar
- Click Create Widget
- Configure your widget:
- Agent — which AI agent answers calls from this widget
- Display name & subtext — shown to visitors
- Primary colour — matches your brand
- Avatar — upload a profile image (displayed when the agent is idle)
- Speaking avatar — optional image shown when the agent is talking
- Widget style — Bubble (floating FAB), Pill, or Side Tab
- Position — bottom-right or bottom-left
- Placement mode — Overlay (floating) or Embedded (inline in your page)
- Allowed domains — restrict which websites can use this widget (recommended)
- Click Save
Step 2 — Copy the embed code
After saving, the widget builder shows your embed snippet in the Embed Code panel. Copy it — it looks like this: Overlay mode (floating button):Step 3 — Paste it on your website
Paste the embed snippet just before the closing</body> tag on any page where you want the widget to appear.
HTML site:
next/script or a useEffect to load the script:
Configuration reference
All options passed toTruedyWidget.init():
Identity
Display
Layout & Position
Behaviour
Domain restrictions (recommended)
Lock your widget to your own domains so it cannot be used on other sites. Set allowed domains either in the dashboard UI or in theallowedDomains config option:
*.mysite.com) match all subdomains. The check runs both client-side (blocks render) and server-side (blocks call creation), so it cannot be bypassed.
Embedded mode
To place the widget inline inside your page layout rather than as a floating overlay, useplacementMode: "embedded" and add a <div> target:
div, inheriting its width. Use CSS to control size and positioning.
Programmatic control
You can trigger the widget from your own buttons or application logic:React / SPA lifecycle cleanup
When using the widget in a single-page app, calldestroy() to clean up when the component unmounts:
Post-call transcript
EnableshowPostCallRecap: true to automatically show the visitor a summary of the conversation after the call ends. This is useful for support or sales contexts where the visitor wants a record.
call.ended event with the full transcript when each call finishes.
Troubleshooting
Widget doesn’t appear- Check browser console for errors
- Ensure the script URL is correct:
https://api.truedy.ai/widget.js - Confirm
widgetIdandagentIdare valid UUIDs
- Your current domain is not in the widget’s
allowedDomainslist - Add your domain in the dashboard under Widgets → Edit → Allowed Domains, or remove the restriction entirely during development
- The page must be served over HTTPS (or localhost) — browsers block mic access on plain HTTP
- The visitor must grant microphone permission when prompted
- Verify your agent is set to Active in the dashboard
- Check that the agent has been saved and synced (a spinner may appear briefly after creation)
- Ensure the visitor hasn’t muted the browser tab
- Some corporate networks block WebRTC — this is outside Truedy’s control
Next steps
- Webhooks — receive call events and transcripts on your server
- Creating an Agent — configure your AI agent’s voice, personality, and tools
- Custom Voice Widget — build a fully custom widget UI with the Ultravox SDK
- Calls API Reference — low-level docs for programmatic Web Call creation

