How does the embed widget work?
Overview
The embed widget lets you add a Dyva character to any website with a single script tag. Visitors can chat with your character directly on your site without leaving the page.
Installation
Add the embed snippet to your HTML, just before the closing body tag. You will need your character's ID (found in Character Settings → API) and a read-scoped API key.
Customization
Configure the widget's appearance and behavior with data-* attributes:
data-theme — light, dark, or auto (matches user's system preference)
data-position — bottom-right, bottom-left, top-right, top-left
data-primary-color — hex color for the widget accent (e.g., #3B82F6)
data-greeting — custom greeting message shown when the widget opens
data-width — widget width in pixels (default: 380)
data-height — widget height in pixels (default: 520)
Features
- Responsive — adapts to mobile screens automatically
- Memory — the character remembers returning visitors (identified by browser fingerprint)
- Streaming — responses stream in real-time, just like the main platform
- Theming — inherits your site's look and feel through color customization
Full documentation with advanced options, event hooks, and programmatic control at dyva.ai/docs/embedding.
The embed widget requires an API key with read scope at minimum. For security, create a dedicated key with only the scopes the embed needs — do not reuse your admin key.
Not finding it?
AI answers instantly. Humans follow up within 24 hours.