Ultron Widget

Drop-in chat for any agent you built in Ultron. One script tag.

The embed

<script
  src="https://ultron-widget.pages.dev/v1.js"
  data-agent-id="01KRW..."
  data-token="wt.eyJv...<sig>"
  data-title="Support"
  data-position="bottom-right"
  data-theme="dark"
  data-accent="#6b8aff"
  defer></script>

Paste this into any page. The widget renders a floating bubble; click it to open the chat. The token expires (default 30 min) — your backend mints a fresh one per session.

Minting a widget token

POST https://ultron-agent-runtime.catalin-932.workers.dev/widget/token
Authorization: x-ultron-api-key: $UC_KEY
Content-Type: application/json

{
  "agent_id":     "01KRW...",
  "owner_id":     "your-ultron-user-id",
  "ttl_seconds":  1800
}

→ { "token": "wt.eyJv...<sig>", "expires_at": 17... }

Your backend holds the master UC_KEY and mints a per-session widget token scoped to one agent + one owner. The browser only ever sees the short-lived token.

Configuration

data-agent-id required

The Ultron agent ID this widget talks to.

data-token required

A widget token minted by your backend. Expires per the TTL you set.

data-backend

Override the Worker URL. Defaults to the production agent-runtime.

data-position

bottom-right (default) · bottom-left · top-right · top-left

data-theme

dark (default) · light

data-accent

Brand color hex, e.g. #6b8aff. Drives bubble + sends + dots.

data-title / data-subtitle

Header text in the chat panel.

data-greeting

Optional opening assistant message rendered before the user types.

data-end-user-id

An identifier for the visitor on your site. Stored on each conversation row.

window.UltronWidget

Public JS API: open(), close(), toggle(), isOpen().

Try the live demo

The widget below is loaded with a real, short-lived widget token. Click the bubble in the bottom-right to chat with a sample agent.

View source

End-to-end checklist

  1. Build an agent. Use the templates: agent from-template <slug> <owner>.
  2. Mint a token. Your backend calls POST /widget/token per user session.
  3. Embed. Server-render the <script> with the fresh token in data-token.
  4. Rotate. When the TTL nears, refresh the page (or re-mint via your backend).