Embed Script
Paste a widget loader script tag into any HTML page. No npm packages, no build step - works on any platform that renders HTML.
Quick Start
Copy the embed code from the Returning.AI app and paste it into your HTML. The script tag includes data-* attributes for identity, theming, and configuration.
<script
src="https://prod-widgets.returning.ai/widget-loader.js"
data-widget-id="YOUR_WIDGET_ID"
data-widget-type="custom"
data-container="returning-ai-widget-YOUR_WIDGET_ID"
data-email="user@example.com"
data-theme="dark"
data-width="100%"
data-height="100%"
data-api-url="https://prod-widgets.returning.ai"
data-widget-url="https://prod-widgets.returning.ai/custom-widget"
></script>See the Auth - Attribute guide for the full walkthrough including dynamic attribute building and security through stacking.
Need server-verified identity?
Use the Widget SDK with Access Key Embed instead. It provides server-verified authentication with bundle mode rendering for the best experience.
When to Use
The embed script works on any platform that supports HTML. No npm, no bundler, no framework required.
- WordPress, Shopify, Squarespace, or any CMS
- Static HTML sites
- Platforms where you cannot install npm packages
- Email templates or webviews with limited JavaScript support
If you can install npm packages and have backend access, consider the Widget SDK instead for Access Key authentication and bundle mode rendering.