Docs · Product

Chat widget

One script tag, no dependencies. Drops into any HTML page, renders in its own shadow DOM, and starts collecting messages immediately.

Install

Copy the snippet from Settings → Installation — it comes pre-filled with your workspace ID, with tabs for plain HTML, WordPress, React, and Next.js. The plain-HTML version:

index.htmlhtml
<script async
  src="https://leadiosa.com/widget.js"
  data-workspace="YOUR_WORKSPACE_ID">
</script>

The script loads asynchronously, mounts a launcher button in the corner, and connects to the real-time backend when the visitor opens the chat.

Tip
On WordPress, skip the manual snippet — install the Leadiosa plugin instead. It injects the widget, walks you through a first-run wizard, and can sync your WooCommerce catalog into the AI knowledge base. See Integrations.

Data attributes

AttributeDefaultDescription
data-workspaceRequired. Your workspace ID from Settings → Installation.
data-titleFrom workspace settingsOverrides the chat panel heading for this page.
data-colorFrom workspace settingsOverrides the accent color for this page (any CSS color).

Everything else — welcome text, launcher position, required visitor fields, offline behaviour — is configured per workspace in Settings → Widget and applies everywhere the widget is installed, no redeploy of your site needed.

The launcher sits bottom-right by default; switch to bottom-left during onboarding or later in Settings → Install — it takes effect everywhere the widget loads, including through the WordPress plugin.

Appearance and language

The widget ships in eleven languages and picks the visitor's automatically from navigator.language, falling back to English.

It renders inside a closed shadow DOM, so your site's CSS never bleeds into the widget and the widget's styles never leak out. It won't conflict with React, Vue, htmx, or anything else on the host page.

Targeted messages

Instead of greeting everyone the same way, the widget can open with a message written for what the visitor is actually doing — lingering on the pricing page, returning for a second visit, or moving the cursor toward the browser bar with a full cart.

Rules are authored in Settings → Widget → Targeted messages and evaluated in the visitor’s browser, so a rule costs no extra request on your site and works on pages served from a cache or CDN. The first rule that matches wins — two messages never stack on one visitor.

A rule can require any combination of: page URL contains (or does not contain) a fragment, referrer, utm_source, visit number, scroll depth, exit intent, device type, and whether anyone is available to reply. Each rule also sets its delay and how often one person may see it — once per visit, once ever, or on every page.

Tip
Every rule counts how often it was shown and how often it led to an opened chat, so you can tell which message actually earns conversations and drop the ones that don’t.

Hosted chat page

Every workspace also gets its chat as a standalone page — a link that works with no website at all. Put it in an Instagram bio, behind a QR code by the counter, or in an email signature; messages land in the same inbox as the widget, with the same greeting, colours, pre-chat fields and AI agent.

text
https://leadiosa.com/chat/YOUR_WORKSPACE_ID

Copy your link from Settings → Widget → Chat page . The page is deliberately not indexed by search engines — it is a conversation surface, not content.

Allowed domains

By default the widget answers on any domain that embeds your workspace ID. To stop someone else from mounting your widget on their site, list your domains under Settings → Widget → Allowed domains. Once the list is non-empty, the backend rejects widget sessions from any other origin.

Watch out
Your workspace ID is visible in your page source — that's by design, it isn't a secret. The allowed-domains list is what makes it useless to anyone else. Set it before going live.

Controlling it from your code

Once loaded, the widget exposes a small global — window.LeadiosaChat — for driving the panel from your own buttons and links:

javascript
LeadiosaChat.open();    // open the chat panel
LeadiosaChat.close();   // close it
LeadiosaChat.toggle();  // toggle open/closed

Prefer event-driven wiring without touching globals? Dispatch the equivalent events on window:

javascript
document.querySelector("#talk-to-us").addEventListener("click", () => {
  window.dispatchEvent(new Event("leadiosa:open"));
});
// also available: "leadiosa:close", "leadiosa:toggle"

Files and attachments

Visitors can attach a file to a chat message, and operators can send files back. Accepted types: PNG, JPEG, GIF and WebP images, PDF, plain text, CSV, Word (.doc/.docx), Excel (.xls/.xlsx) and ZIP. Anything else is refused with a message rather than silently dropped.

Size and count depend on the plan: Free allows 2 MB per file and 5 files per conversation, Pro 10 MB and 15, Pro Plus 50 MB with no per-conversation limit. Images preview inline in the inbox; other types are offered as a download.

Tip
The file picker offers exactly the types the server accepts, so a visitor can’t pick something that would be rejected after uploading.

Privacy and consent

When a visitor sends a message, you (the workspace operator) become the data controller for that message under GDPR — see our GDPR page for the full breakdown.

We recommend mentioning live chat in your privacy notice, and (if your cookie banner gates non-essential scripts) only loading widget.js after the visitor opts in. The widget stores a session identifier in the visitor's browser so they can return to the same conversation later.

If a visitor left their email, Leadiosa emails them automatically when they go offline mid-conversation — every reply they haven't read yet, plus the full chat log, sent once about fifteen minutes after your last message so they don't miss you.