Vanilla Agent Demo

This page renders the widget two ways: once through the vanilla initializer and once as a floating launcher wired up to user actions.

The frontend proxy below lives at /api/chat/dispatch and is powered by a Hono server.

Looking for other examples?

Programmatic Control

The widget controller returned by initAgentWidget provides methods to programmatically control the widget:

const launcherController = initAgentWidget({
  target: "#launcher-root",
  config: { /* ... */ }
});

// Open the widget
launcherController.open();

// Close the widget
launcherController.close();

// Toggle the widget (open if closed, close if open)
launcherController.toggle();

You can use these methods with your own UI elements, event handlers, or any JavaScript code. The buttons above demonstrate this functionality.

Inline Embed