Skip to main content

Overview

The widget is a standard Web Component (<agent-chat>). Drop one script tag and one HTML element into any page — React, Angular, Vue, plain HTML — and it works. The host app doesn’t need to install React or any chat dependencies. Requires agent-manager running (not agentctl serve). See Quickstart — Path 2.

Basic embed


Modes

Floating (launcher button)

A circular button in the corner. Clicking it opens the chat panel.
position options: bottom-right (default), bottom-left

Inline

Renders as a fixed panel directly in the page — no launcher button.

All attributes


Script-only embed (no HTML tag)

For apps where you can only inject a <script> — like a CMS or a platform that restricts HTML — the widget auto-mounts if you set window.agentChatConfig:
If no <agent-chat> element exists on the page, the widget creates one on <body> automatically.

Framework integration

React

Angular

Allow custom elements in your module:
Then use it in a template:

Vue / plain HTML

No setup needed — just the script tag and the element.

Listening to events

The widget emits a DOM event after each answer, with routing and tool metadata:
Only safe metadata is exposed — no internal reasoning, no prompt content.

Streaming

The widget connects to the streaming endpoint (POST /conversations/{id}/messages/stream) and renders tokens as they arrive. If streaming fails before a usable answer, it falls back to the standard endpoint automatically.

Session recovery

The widget stores the conversation_id in localStorage. If the backend restarts and no longer knows that conversation, the widget detects it, clears the stale id, and starts a fresh conversation automatically — no action needed from the user.