Returning.AI
  1. Widgets
Returning.AI
  • Returning.AI
    • Authentication
    • System API
      • Auth
        • secure auth
        • register
        • verify email
        • login
      • Server
        • create new server
        • get my servers
        • update server
        • role list of server
        • channel list of server
      • Channel
        • get channels list
        • create new channel
        • update channel
        • delete channel
      • Role
        • create new role
        • update role
        • delete role
        • add role to a user on a server
        • remove role from a user on a server
        • get role list of user on a server
      • Badge
        • get badges list
        • create new badge
        • update badge
        • delete badge
        • award badge to user
        • remove badge from user
    • Integration API
      • Users
        • Get Users with Filters
        • Create New User
        • Get User Data
        • Manage User Account
        • Get User Gamification History
        • Get User Gamification Stats
        • Bulk Import
        • Bulk Update
      • Messages
        • Send Message
        • Reply Message
        • React Message
      • Channels
        • Get Channels List
      • User Api Key
        • Get User Api Key
        • Post User Api Key
        • Update User Api Key
        • Delete Endpoint
        • api key info
    • Application API
      • Community Users
        • Get community users
        • Get user
      • User Fields
        • Get all user fields for a community
        • Get specific user field
        • Create user field
        • Update user field
        • Delete user field
      • User Field Histories
        • Get all user field histories in a community
        • Get user field histories for a specific field
        • Get user field histories for a specific user
        • Get user field histories of specific user field and user
        • Create user field history for specific user
    • Events
      • Outgoing webhooks
        • Encryption
        • User Joins Server
        • User Visits server
        • New Message Posted Anywhere
        • New Message Posted To channel
        • Purchased Store Item
      • Incoming webhooks
        • API Keys & Encryption
        • Send message into channels
        • Update Custom User Fields
        • Update In-game currency
    • Widgets
      • Channels
      • Socials
  1. Widgets

Channels

All channels types can be made into a widget, toggle on Enable Wigets in the channel setting page.
After configuring the appearance of the widget, copy the codes provided at the bottom for each widget types.

Public widget#

A read-only display of all the messages of the channel, with a optional CTA button to be included.
Simple set up: Include the iframe code anywhere on your platform!
Example:
<iframe 
    src="https://prod-widgets.returning.ai/channel-   widget/NjUwN2M4NjFkJkYTYxNTAzYkY2U5/open-widget" 
    id="returningAiWidgetIframe" 
    frameborder="0" 
    width="100%" 
    height="100%">
</iframe>
No Authentication: All users who visits your site will be able to see the widget.
CTA button can be linked to any URL: default URL links users to the server.
CTA button appears at the bottom right of the page.
Button content and URL can be set up in the settings.

Authenticated widget#

Embed the whole chat room onto your site, users will be able to view and send messages via the widget!
Requires more development effort:
1.
Collection and saviong of each user's token
Example:
     fetch('https://prod-widgets.returning.ai/channel-   widget/NjUwN2M4NjFkJkYTYxNTAzYkY2U5/signin', 
     {
        method: 'POST', 
        headers: {
          'returningai-api-key': 'df09a52de262f1f802950815864',
          'email': '{email}',
          'Content-Type': 'application/json',
        }
      }).then((res) => {        
        res.json().then(data => {
          localStorage.setItem('returning-ai-widget-token', data.token)
        })
      }).catch((err) => {
        console.log(err)
      })
2.
Add Event listerner to get the token
Example:
 <script>
    window.addEventListener('message', (event) => {
      if (event.origin === 'https://prod-widgets.returning.ai') { // Check origin for security
        const { type } = event.data;
        if (type === 'RETURNINGAI_WIDGET_TOKEN') {
            const value = localStorage.getItem('returning-ai-widget-token');
            // Send the value back to the parent window
            event.source.postMessage({ type: 'RETURNINGAI_WIDGET_TOKEN', value 
            }, event.origin);
        }
      }
    });
</script>
3.
Add the iframe into the site's code
<iframe src="prod-widgets.returning.ai/channel-   widget/NjUwN2M4NjFkJkYTYxNTAzYkY2U5" allow="clipboard-write" id="returningAiWidgetIframe" frameborder="0" width="100%" height="100%"></iframe>
  
Modified at 2025-09-09 03:57:36
Previous
Widgets
Next
Socials