Skip to main content

Overview

The Weav Chatbot Widget is a lightweight, embeddable chat interface that lets you add AI-powered customer support to any website. It renders a customizable launcher button that opens a chat interface in an iframe, and it can be controlled through a simple JavaScript API.
The configuration options below are to provide developers with more flexibility of the Weav chatbot experience. Most of these features can be controlled within the Weav application for non developers.

Features

  • Fully customizable appearance, including colors, icons, text, position, and theme
  • Mobile responsive with optimized layouts
  • Accessible, including ARIA labels and keyboard support with the Esc key
  • Lightweight with minimal performance impact
  • Secure iframe isolation
  • JavaScript API for initialization, teardown, and event handling

Installation

Basic usage

  1. Include the widget script near the end of your <body> tag.
  2. Call window.WeavWidget.init() once the script has loaded.
The widget automatically injects its mount node and lazy-loads the iframe the first time it opens.

Quick start example


JavaScript API

Once loaded, the script registers a single global object: window.WeavWidget.

Configuration options

Pass configuration through the object supplied to init(). agentSlug is required. All other properties are optional.

Top-level options

Branding options

Use the branding object to customize the launcher button.

Widget options

Use the widget object to customize behavior and appearance.

Widget modes

Button icons

Button positions

Examples

Minimal configuration

Custom branding

Custom icon using an image URL

Left-aligned launcher button

Dark mode widget

Custom widget messages

High z-index for complex sites


Programmatic control

  • Use window.WeavWidget.open() to open the widget without user interaction
  • Use window.WeavWidget.close() to close it programmatically
  • Use window.WeavWidget.destroy() to remove the widget entirely
  • Use window.WeavWidget.init(newOptions) at any time to re-initialize the widget with updated configuration\
Queued open() and close() calls made immediately after init() run as soon as the React tree is ready, so you do not need to wait for a callback.

Events

Use on() and off() to react to widget lifecycle events.
Listeners run inside a guard so thrown errors are logged without breaking other listeners.

Custom mount point

Provide mountElement if you want to render the widget inside your own container.
The widget clears the provided element before rendering. Calling destroy() leaves the element in place so you can reuse it for future mounts.

Triggering the widget from custom elements

You can open the widget and optionally send a pre-filled message from any element on your page. This is useful when you want buttons, links, or other UI elements to start a specific conversation.

Open and send a message by element ID

Open and send a message by class name

Multiple trigger buttons

You can attach different messages to different elements.

Advanced usage

Programmatic control only

The launcher button is visible by default. To hide it and control the widget entirely through JavaScript, set launcherHidden: true and use open() and close().
When launcherHidden is true, the launcher button is completely hidden and the widget can only be opened with window.WeavWidget.open(). This is useful when you want to integrate the widget into your own custom UI.

Re-initializing with new options

Re-initializing ensures updated configuration values are applied cleanly.