Embed Widgets

Embed Widgets let your backend authenticate a website visitor, while Vonative provides the chat, voice, or LiveAvatar experience. The visitor token is signed on your server. Never send a widget signing secret to the browser in production.

Widget types

Every widget targets exactly one assistant or workflow and supports popup or inline display mode.

Integration flow

  1. Your backend creates a widget through the authenticated Vonative API.
  2. Save the returned signing secret in your server-side secret store. It is returned only at creation and rotation.
  3. Configure each website origin that may load the widget.
  4. When an authenticated visitor loads your page, your backend mints a short-lived visitor JWT.
  5. Your page loads the Vonative embed script with the widget ID, visitor JWT, and any optional cosmetic overrides.
  6. The script verifies the origin and token through Vonative, then starts the configured runtime.

Create a widget

Use your Vonative API bearer token from a trusted server.
Pass either assistant_id or workflow_id, using its public UUID, not its internal database ID. For LiveAvatar, also pass an avatar_id.

Supported branding keys

The widget branding object supports these stable keys:

Manage allowed origins

Allowed origins are exact origins such as https://www.example.com. Wildcard subdomains use *.example.com. Do not include paths.
The authenticated management endpoints are:
Rotating the secret invalidates visitor JWTs signed with the previous secret.

Mint a visitor JWT

Mint a fresh HS256 token on your server for each page load or session refresh. Tokens must include: Example using the jose package in a Node.js server route:
job metadata also stays JWT-only. Do not trust or forward those values from snippet HTML.

Cosmetic-only HTML snippet

You can add cosmetic overrides directly to the snippet. These override saved widget branding for that placement only.
For an inline widget, add data-vonative-mode="inline":
The embed accepts legacy data-boboyii-* attributes during the compatibility window, but new integrations should emit only data-vonative-*.

Trusted vs untrusted fields

The snippet is only for widget bootstrapping and cosmetics. Visitor identity stays in the signed JWT.

SPA token refresh

For single-page apps, retrieve a newly minted token from your backend before mounting the script. Remove an existing script before adding a new one to avoid mounting twice.

Test and troubleshoot

Test from a page hosted at an allowed origin, for example http://localhost:3000. Do not test by opening embed.vonative.com directly. The public runtime endpoints are used by the embed script and do not require your Vonative API bearer token:
They validate the requesting origin and the visitor JWT before returning any runtime connection details.