Web widget installation
Add the Liya live chat and AI widget to your website or web app in a few minutes.
Add the script tag
Paste the following snippet before the closing </body> tag on every page where you want the widget to appear. Replace YOUR_EMBED_TOKEN with the token for your workspace.
liya_pub_. Save your widget settings first so the token is created.Customising the widget
Most of the widget's look and behaviour (logo, welcome screen, quick replies, launcher style) is set in Control Center → Chat Widget and applies without changing your site. A few options can also be set directly on the script tag, and the tag always wins over the dashboard:
| Attribute | Default | Description |
|---|---|---|
| data-token | required | Your workspace embed token |
| data-api | required | The Liya API address, https://api.liyasupport.com |
| data-title | Ask us anything | Title in the chat header |
| data-greeting | Hi! How can I help you today? | The first message shown to visitors |
| data-color | #0ea5e9 | Accent colour for the launcher and header |
| data-position | bottom-right | Launcher position: bottom-right or bottom-left |
| data-mode | bubble | bubble for a floating chat window, side-panel for a panel docked to the page edge |
Testing the installation
Load your website
Open the page where you added the snippet. You should see the chat launcher in the corner you chose.
Send a test message
Click the launcher and type a test message. It should appear in your Liya inbox as a new conversation within a few seconds.
Verify AI draft
Open the conversation in your dashboard. If you have knowledge base content set up, you should see an AI draft ready for review.
Troubleshooting
Widget not appearing
- Check the browser console for JavaScript errors. The widget logs a warning if the token or API address is missing.
- Confirm
data-tokenis the full token with no extra spaces or quotes, and thatdata-apiishttps://api.liyasupport.com. - Confirm the script address is
https://liyaengine.ai/widget.js. Snippets that point atwidget.liyasupport.comorcdn.liyasupport.comare out of date and will not load. - If you have a Content Security Policy, allow the script and API addresses shown below.
Conversations not appearing in inbox
- Ensure your workspace is on an active plan.
- Check the embed token is still active in Control Center → Chat Widget.
- Try a hard refresh (
Cmd/Ctrl + Shift + R) in the dashboard.
Content Security Policy
Add the following directives to your CSP header to allow the widget to load and communicate: