Embed Script
Use this legacy loader only when Returning.AI explicitly approves it for your supplied setup. It needs a page that permits the supplied JavaScript, but does not require npm or a frontend build step.
Quick Start
Obtain the approved embed code from your Returning.AI setup contact. Your engineering team must supply the trusted identity/session wiring; do not copy a sample customer ID into production. 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-customer-id="CUST-10482"
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 legacy no-backend constraints.
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
Use the approved loader on a website that permits its script and iframe. A CMS may restrict either; verify its publishing and security settings. No npm, bundler or frontend framework is required.
- WordPress, Shopify, Squarespace, or any CMS
- Static HTML sites
- Platforms where you cannot install npm packages
- Approved webviews where the supplied script and iframe have been tested
For new personalized widgets, start with the Widget SDK and a protected backend token route, including for plain HTML. If a public campaign banner meets your goal, use the separate banner guide. A banner is not a substitute for a personalized rewards experience.