Web widget
The web widget lets visitors talk to your agent from your website. Web calls appear in the same call log as phone calls.
Add the script
Section titled “Add the script”Create an embed token under Deploy → Web widget, add your site to the allowed origins, then paste the snippet before </body>:
<script src="https://app.lightmove.ai/embed/lightmove-widget.js?token=YOUR_TOKEN&apiEndpoint=app.lightmove.ai" async></script>Embed modes
Section titled “Embed modes”Choose the mode in the token settings:
| Mode | What visitors see |
|---|---|
| Floating | A talk button in the corner of every page. |
| Inline | The widget renders inside an element with id="lightmove-inline-container". |
| Headless | No UI. Your page drives the call with the JavaScript API below. |
JavaScript API
Section titled “JavaScript API”The script exposes window.LightMoveWidget:
const widget = window.LightMoveWidget;
widget.onStatusChange((status) => { // idle | connecting | connected | failed console.log('call status', status);});
document.querySelector('#talk').addEventListener('click', () => widget.start());document.querySelector('#hang-up').addEventListener('click', () => widget.stop());Other callbacks: onCallStart, onCallConnected, onCallDisconnected, onCallEnd and onError.
Pass context about the visitor
Section titled “Pass context about the visitor”Add data-lightmove-context to the script tag, or call setContext() before starting a call. Values are available to your agent’s prompts as {{initial_context.<name>}}.
<script src="https://app.lightmove.ai/embed/lightmove-widget.js?token=YOUR_TOKEN&apiEndpoint=app.lightmove.ai" data-lightmove-context='{"plan":"pro","page":"pricing"}' async></script>window.LightMoveWidget.setContext({ customer_name: 'Aoife' });