The <agent-widget> AI agent widget

A web component that puts a confcall AI agent on your page, as a text chat, a voice call, or both. It talks to the AI conference agent at agent.confcall.app and works in any framework.

What it is

<agent-widget> embeds an AI agent you configured in the Builder. It is different from the <conference-room> widget, which embeds a live room (people in a call). An agent inside a meeting is invited into a room and reached through <conference-room>; <agent-widget> is for talking to the agent directly.

Install

<script src="https://widget.confcall.app/agent-widget.umd.js"></script>

The script registers the agent-widget custom element. Load it before you use the element.

Text mode quick start

Text chat is the default. You need a config-id, the api-url, and an api-key (see Authentication).

<script src="https://widget.confcall.app/agent-widget.umd.js"></script>
<agent-widget
  config-id="YOUR_CONFIG_ID"
  api-url="https://agent.confcall.app"
  api-key="YOUR_API_KEY"
  title="Support"
></agent-widget>

Voice mode

Add voice-enabled together with signalr-url and agent-api-url. The widget then shows a microphone control. The browser asks for microphone permission when the user starts a call, or when your code calls startVoice().

<script src="https://widget.confcall.app/agent-widget.umd.js"></script>
<agent-widget
  config-id="YOUR_CONFIG_ID"
  api-url="https://agent.confcall.app"
  api-key="YOUR_API_KEY"
  title="Support"
  voice-enabled
  signalr-url="https://meet.confcall.app"
  agent-api-url="https://agent.confcall.app"
></agent-widget>

Voice needs a page served over HTTPS (or localhost) so the browser allows microphone access.

Hybrid mode

With the voice snippet above, the same widget offers both text and voice and the user switches between them. widget.widgetMode reports chat, voice or hybrid, and the agent-widget-mode-changed event fires when it changes.

Authentication

There are two ways to authenticate the widget:

A JWT needs these scopes, depending on the features you use:

FeatureScope
Chat sessionsuse:chat-agent
Voice callsuse:voice-agent
IVR config accessread:ivr-config

Find your config-id and create a key

In the Builder, open your agent and choose Embed. The dialog shows a ready-made snippet with your config-id filled in. Create a publishable key in the Builder's API keys page, add your site's origin to its allowed origins, and replace YOUR_API_KEY.

Attributes

AttributeRequiredDescription
config-idYesThe agent configuration ID from the Builder.
api-urlYesBase URL of the chat API, https://agent.confcall.app.
api-keyOne of api-key / auth-tokenPublishable key (pk_live_… or pk_test_…).
auth-tokenOne of api-key / auth-tokenShort-lived JWT sent as a Bearer token.
tenant-idNoTenant identifier (default default).
titleNoHeader title (default Chat).
agent-nameNoAgent name shown in the header. Overrides the name saved in the Builder.
agent-avatarNoAvatar image URL shown in the header. Overrides the avatar saved in the Builder.
builder-urlNoBuilder base URL the widget reads saved branding from (default https://builder.confcall.app). Attributes on the tag always win over the saved branding.
openNoBoolean. Show the widget on load.
embeddedNoBoolean. Fill the parent container instead of floating.
voice-enabledNoBoolean. Enable voice calling.
signalr-urlWith voiceBase URL of the SignalR server for voice signaling (e.g. https://meet.confcall.app). The widget appends the /videohub hub path itself — do not include it.
agent-api-urlWith voiceAgent API URL used to invite the agent to the call.
positionNobottom-right (default) or bottom-left.
fab-iconNoURL of an image to use for the floating launcher button.
visualizationNoVoice-call visualizer: aurora, constellation, halo or silk. Default: silk. Unsupported values fall back to silk.
modeNoModality: chat (transcript and text input, no call button), voice (voice panel, no text input) or mixed (both). Default: mixed when voice-enabled is set, otherwise chat.
langNoWidget language: en, es, fr, nl, de, hu, ro, sr, cs, sk or it. Default: the visitor's browser language, falling back to English. Unsupported values are ignored.

Methods

MethodDescription
open() / close()Show or hide the widget.
endSession()End and clear the current session.
restartSession()End the current session and start a new one.
startVoice() / endVoice()Start or end a voice call (needs voice-enabled).
toggleVoice() / toggleMute()Toggle voice, or mute the microphone.

Events

Events are CustomEvents on the element; payloads are in e.detail.

EventFires when
agent-widget-session-startedA new session starts.
agent-widget-session-restoredA saved session is restored after a reload.
agent-widget-session-endedThe session ends.
agent-widget-message-sentThe user sends a message.
agent-widget-message-receivedThe agent replies.
agent-widget-closeThe user closes the widget.
agent-widget-voice-startedA voice call starts.
agent-widget-voice-endedA voice call ends.
agent-widget-voice-statusThe voice status changes.
agent-widget-mode-changedThe widget mode changes.

Theming

Style the widget with CSS variables on the element:

agent-widget {
  --cw-primary-color: #2563eb;
  --cw-primary-hover: #1d4ed8;
  --cw-background: #ffffff;
  --cw-surface: #f1f5f9;
  --cw-text: #1e293b;
  --cw-text-muted: #64748b;
  --cw-border: #e2e8f0;
  --cw-radius: 12px;
}

Session persistence

The widget saves its session in localStorage under agent-widget-session-{config-id}, one per config-id. After a reload it restores the conversation until the session expires on the server. Call endSession() to clear it.

Troubleshooting