Before you start
You need your widget’s embed snippet. In the dashboard, open your campaign and go to the Web Widget tab → Embed Code panel. The snippet there has your real widget ID and host pre-filled - the only thing you add is thehide-launcher attribute.
Embed the widget with hide-launcher
Paste the embed snippet into your page and add the
hide-launcher attribute. The widget mounts and runs, but renders no UI of any kind.Make any element the trigger
Any button, link, or image on your page can start a call or send a chat message.
You don’t need to wait for the widget to load before calling
startCall() - calls made early are buffered and fire automatically once the widget is ready.React to events
The widget reports everything through standard DOM events on the
<voiceai-widget> element. Use them to drive your UI state.Embed reference
Custom element attributes
| Attribute | Required | Description |
|---|---|---|
id | Yes | The widget ID from the dashboard (Web Widget tab). Public identifier - safe to expose in page source. |
host | Yes | Backend host serving the widget config and APIs (your domain or white-label domain). A bare host is auto-prefixed with https://. |
hide-launcher | No | The Headless Mode switch. Boolean attribute (presence = on). The widget mounts and runs but renders no UI of any kind - no launcher, no call panel, no chat window, no consent popup, not even during an active call. |
Local development only: an additional
http-only="true" attribute keeps a protocol-less host on http:// instead of upgrading to https://. Never use it in production.Programmatic init (alternative to the custom element)
If you prefer to initialize the widget from JavaScript instead of placing the custom element in your markup:init().
Global conveniences
window.VoiceAIWidget.startCall(), stopCall(), sendChatMessage(text), endChatSession(), and acceptConsent() proxy to the first mounted widget instance. Convenient for single-widget pages; with multiple widgets, call methods on the specific element instead.
Multiple widgets per page
Supported. Each<voiceai-widget> element is independent - methods are called on the element, events fire on the element. The globals target the first instance only.
Using a framework?
No framework bindings are needed - grab the element (with a ref orquerySelector), call methods on it, and add event listeners. The API is plain DOM, so it works identically in React, Vue, Next.js, Svelte, and Webflow custom code.
In single-page apps, removing the
<voiceai-widget> element from the DOM destroys the instance and ends active sessions. If conversations must survive client-side navigation, mount the element once at the layout level.Next steps
Methods reference
Every method, including edge behavior and the readiness model.
Events reference
All events with payloads and ordering guarantees.

