Installation
The widget requires React 18+ or React 19+ as a peer dependency. If your project doesn’t use React, use the UMD / CDN approach below.
Quick Start
ES Module
CommonJS
UMD / CDN
If you’re not using a bundler, load the widget from a CDN:Options
| Option | Type | Default | Description |
|---|---|---|---|
url | string | — | Required. The published agent URL |
type | 'tray' | 'full-screen' | 'chatbar' | 'tray' | Widget layout. See Widget Types |
theme | 'dark' | 'light' | 'dark' | Color theme |
hideLogin | boolean | false | Hide the Thesys login UI inside the agent |
identityToken | string | — | Signed HS256 JWT for BYOI user identity |
getIdentityToken | () => Promise<string> | — | Callback for automatic token refresh on expiry |
preload | boolean | false | Load the agent iframe in the background immediately |
options | TrayOptions | FullScreenOptions | ChatbarOptions | — | Type-specific options. See Customization |
Widget Instance
embedWidget() returns a WidgetInstance with methods for programmatic control:
Direct iframe (Alternative)
If you prefer not to use the npm package, embed the agent directly with an iframe:Next Steps
- Widget Types — Choose the right layout for your use case
- Customization — Theme the chatbar and configure options
- User Identity (BYOI) — Identify users and isolate their conversations