Returning.AIDocs
v1

Guides / Custom Widget SDK

.md

Custom widgets

Widget catalog

Every configured experience uses the same <rai-custom-widget> element. The widget ID chooses the configuration; the bundle URL loads that widget's code.

Pair the widget ID and bundle

Returning.AI supplies both values for each experience. Different widget IDs can use the same bundle, so do not infer one value from the other.

The widget ID identifies your configured widget. Copy it exactly as supplied; do not convert it to a number or decode it. It cannot be worked out from the experience name or bundle URL. Ask your Returning.AI contact for a ready-to-paste snippet with the actual widget ID and matching bundle URL for your environment. Your server supplies the short-lived embed token separately.

This is an unfinished template. Replace YOUR_WIDGET_ID and TOKEN_FROM_YOUR_SERVER before using it.

embed-template.html
<rai-custom-widget
  widget-id="YOUR_WIDGET_ID"
  bundle-url="https://prod-widgets.returning.ai/custom-widget/bundle/milestones/widget.js"
  embed-token="TOKEN_FROM_YOUR_SERVER"
  height="auto"
></rai-custom-widget>

Shared bundles are expected

Onboarding quests and All quests both use milestones/widget.js. Mini games and Raffles both use mini-games/widget.js. Their widget IDs keep the configured experiences separate.

Available bundles

These bundle URLs identify the widget code, not your configured widget. Account-specific widget IDs are supplied separately during setup.

Experience

Onboarding quests

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/milestones/widget.js
Experience

All quests

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/milestones/widget.js
Experience

Rewards dashboard

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/earning-overview/widget.js
Experience

Store

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/store/widget.js
Experience

Social quests

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/socials/widget.js
Experience

Streaks

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/streaks/widget.js
Experience

Mini games

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/mini-games/widget.js
Experience

Raffles

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/mini-games/widget.js
Experience

Leaderboard

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/leaderboard/widget.js
Experience

Referrals

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/referral/widget.js
Experience

Activity history

Bundle URLhttps://prod-widgets.returning.ai/custom-widget/bundle/currency-activities/widget.js

Production and dedicated hosts

The default host is https://prod-widgets.returning.ai. Some deployments use a client-specific host. In that case, replace only the host and keep the supplied /custom-widget/bundle/.../widget.js path.

Always use the complete widget ID and bundle URL provided by Returning.AI for the target environment.

Generic legacy bundle

Older custom widgets may use https://prod-widgets.returning.ai/custom-widget/bundle/widget.js. Do not choose this URL for a new integration unless Returning.AI supplied it for that widget.