Embed Widget & SDK
Deploy your AI agent as a chat widget on any website. The embed system provides a drop-in script tag for quick setup and a JavaScript API for programmatic integrations.Quick Setup
Add a single line of code to embed the chat widget:Widget Configuration
Script Tag Attributes
[!NOTE] The appearance (theme, colors, welcome message) is managed securely via your Agent Studio → Deploy settings, preventing unauthorized customization.
Example: Full Configuration
Publishable Keys
For production deployments, you must use publishable keys to authenticate your widget.Create a Publishable Key
Response
Key Security Features
JavaScript SDK
For deeper integration, include the widget package:Installation
window.ThinnestAI:
SDK Methods
SDK Events
Listen for widget events on the globalwindow object:
Agent API Keys
For server-to-server integrations (not browser-based), use Agent API Keys:Styling & Customization
Widget customization is done entirely through the Agent Studio Deploy Panel → Design tab. This leverages an isolated Shadow DOM framework ensuring consistent rendering across environments. You can customize:- General look and feel (Colors, Typography)
- Launcher style and icons
- Popover messages and branding removal
Testing Your Widget
- Local testing — Add
localhostas an allowed origin for your widget key. - Preview in dashboard — Click Test Chat on your agent’s page.
- Test HTML file — Create a minimal HTML file with the embed script.
Best Practices
- Use publishable keys in production with correct origin restrictions.
- Add a welcome message to guide users.
- Match your brand using the Design settings.
- Test on mobile to verify the widget’s layout on your site.

