Available now

Website Widget

Add Lumika chat to your website with one script tag, keep conversation history synced, and control allowed domains for production safety.

What You Get

What you get out of the box

One-line installation

Deploy the widget on any site by inserting a single script tag before closing body.

Session continuity

Widget stores and reuses conversationId to keep context across page reloads.

History hydration

Widget fetches previous messages and polls for new replies from assistant or manual operators.

Domain allowlist

Limit requests to trusted domains so unauthorized origins cannot call your integration.

Works with API parity

Widget uses the same conversation and history endpoints as API integrations.

How Widget Security Works

The mechanics behind the integration

Secure token usage

The widget uses your integration token to authenticate conversation requests to Lumika.

  • Generate a dedicated Website Widget integration for each deployment context.
  • Restrict allowedDomains in account settings for production environments.
  • Requests from non-allowed domains are rejected when allowlist is configured.
  • Rotate to a new integration token if a token was exposed unintentionally.

Conversation and history lifecycle

The widget can continue prior conversations and retrieve assistant/customer message history by IDs.

  • conversationId identifies one customer thread and is reused for continuity.
  • History endpoint excludes internal notes by design.
  • Incremental sync uses afterId to fetch only new records.
  • This supports real-time-like behavior without heavy transport overhead.

Recommended deployment model

Use domain allowlisting and deploy script from your production templates.

  • Insert widget script in your base layout or shared footer template.
  • For SPAs, include the script in the main document shell so it mounts once.
  • For multi-site setups, create separate widget integrations per domain/property.
  • Keep staging and production tokens separate for clear observability and access control.

Widget Installation

Get connected step by step

Copy, paste, verify. Then customize from dashboard settings.

01

Create a Website Widget integration

  • Open Dashboard → Integrations and create a Website Widget integration.
  • Copy the integration token from the account card.
  • Optionally configure allowedDomains before going live.
02

Insert the script tag (or copy from account card)

  • Paste the script just before </body> in your website template.
  • Use the integration token in data-integration-token attribute.
  • Publish and open your site to verify widget initialization.
<script
  src="https://widget.lumika.ai/widget.js"
  data-integration-token="YOUR_INTEGRATION_TOKEN"
></script>
If your site is rendered by a framework, place this snippet in the global layout/footer template.
03

Validate history and live sync behavior

  • Start a chat and reload the page; prior messages should remain visible.
  • Ensure manual messages from Activities appear on next polling cycle.
  • If needed, offer a UI action to start a fresh conversation/session id.

Endpoints

Widget Runtime Endpoints

Website Widget integrations use these conversation endpoints internally for messaging and history sync.

SSE/conversation/sse?integrationToken=...&textContent=...&conversationId=...?

Streams the assistant response for a single user message.

GET/conversation/history?integrationToken=...&conversationId=...&afterId=...&limit=...?

Fetches initial and incremental history with message IDs for deduplication.

Get started

Deploy the Widget in Production

Create a dedicated integration, set allowed domains, and ship the script tag to your website template.