Web Widgets
Chat widget (text me back)
The chat widget is a short "We'll text you!" form: the visitor leaves their name, email and mobile number, and your team texts them back.
<head>
<script src="https://cdn.onepath.ai/loader.js"></script>
</head>
<body>
<button data-onepath-web-chat-trigger>Text me back</button>
</body>
Same loader as the scheduler, no extra script. Any element with data-onepath-web-chat-trigger toggles the panel open and closed.
It is not live chat
Nobody types back inside the widget. Submitting the form creates the customer in OnePath and promises a text message; the conversation continues over SMS. Name the button accordingly ("Text me", "Text us back"), not "Chat now".
What the visitor sees
- Where it opens: a panel in the bottom-right corner on desktop (over a dimmed page), full screen on a phone. It slides up when the trigger is clicked and closes on the ✕ or another click of the trigger.
- Header: a chat-bubble icon and "We'll text you!" on your brand color. No logo is shown in the chat header.
- Form: Full Name, Email, Mobile Phone. All three are required. Validation messages: "Please enter your first and last name", "Please enter a valid email address", "Please enter a valid 10-digit phone number".
- Consent: one unchecked checkbox that opts the visitor in to text messages, with links to your privacy policy and terms. It is optional; the button works without it.
- Button: I Understand, Text Me, enabled once all three fields are filled.
- Success: "We got your message! Our awesome team will be sending you a text message back from the number above."
- Error: "Unexpected Error. We're sorry for the inconvenience…"
- Footer: the privacy/terms line and "Powered by OnePath".
There is no floating bubble. Your site supplies the trigger, so you decide where and how it appears.
Settings that control it
| What | Where |
|---|---|
| On/off (together with the scheduler) | Account settings → Lead Capture → Channels → Web Widgets toggle (Channels) |
| Domains it renders on | same page → Web Widgets card → Allowed websites |
| Brand color and text color | Channels → Web Chat |
| Company name in the consent text | The account name, set under Company: accounts & billing |
Confirming a request from your code
When the form is submitted successfully the widget fires one event on document:
document.addEventListener('onepath:webchat:request_created', (e) => {
const { customer } = e.detail;
console.log(customer.full_name, customer.contacts.phone, customer.contacts.email);
});
customer.contacts.phone is in E.164 format (+15125550100). Use it for a conversion event or a thank-you redirect. See Events.
Chat never fires onepath:widget-ready; the trigger works as soon as the loader has run, so there is nothing to wait for before showing the button.