Chat Widget Setup

The RapiDesq chat widget lets you add real-time live chat to any website with a single script tag. This guide covers every aspect of widget configuration — where its chats go and what that means for visitors and your team, visual theming and placement, pre-chat forms, identity verification, and embedding.

Overview

The chat widget is an embeddable JavaScript component that creates a persistent live-chat interface on your website. When a visitor clicks the chat icon, a conversation window opens and connects them to whatever the widget routes to — one of your teams, a conversation flow or an AI bot — over a real-time connection. Messages are delivered instantly in both directions with no page reloads required.

Use a chat widget when you want visitors on your website to reach you while they are on the page. Every chat that reaches a person becomes a ticket, so it is handled, assigned and reported on like your other work. For questions that do not need an answer straight away, a web form or email may suit better.

Key capabilities of the widget include:

Creating a Widget

A working widget needs three things: a name, a destination for its chats, and its snippet on your website. Everything else has a sensible default you can change later. Follow these steps in order; each links to the section that explains the choice in full.

  1. Navigate to Admin > Channels > Chat Widget in the left-hand sidebar. Click Create Widget for the full editor, or Guided Setup for a four-step version (Name, Appearance, Conversation Routing, Review & Confirm) that offers fewer settings.
  2. Enter a Widget Name — a descriptive label for this widget (e.g., "Main Website Chat" or "Support Portal Widget"), up to 100 characters. This is only visible to your team.
  3. Choose where its chats go. In the Conversation Routing section, pick a Routing Mode and its target. This is the one choice a widget cannot work without:
    • Direct to Team — each chat becomes a ticket on the team you choose and is offered to that team’s available users. Pick this when people should answer every chat. What it means.
    • Conversation Flow — a published flow talks to the visitor first (greets, asks questions, checks your hours) and then hands the chat on, usually to a team. Pick this to qualify or sort chats before a person sees them. Professional plan and up. What it means.
    • AI Bot — an active AI bot answers the visitor from your knowledge base and hands the chat to its escalation team when your hand-off rules say so. Pick this to answer common questions around the clock. What it means.
    • Leaving it unset is not a choice: the editor warns “Nothing is set to receive from this widget” and its chats arrive as unassigned tickets that nobody is told about. What happens.
    Not sure which? See Choosing a destination. Guided Setup offers Direct to Team and, on plans with flows, Conversation Flow; for AI Bot use Create Widget. The Create Widget dialog with the widget named Acme Store Chat, Conversation Routing set to Direct to Team for Customer Success, Appearance open and the editor's other sections collapsed above Cancel and Create Create Widget: name the widget, choose where its chats go, then open each section you want to change.
  4. If your account has more than one brand, choose the widget’s Brand in the same section. It decides which brand the chats belong to and which knowledge bases an AI bot answers them from. More on Brand.
  5. Decide whether to ask for details before the chat starts: turn on Enable pre-chat form in Conversation Start to ask for name, email, phone, company or your own fields (off by default). Pre-chat forms.
  6. Optionally set how it looks and greets: Primary Color and Header Text (Appearance), where the launcher sits (Position & Placement), and the Welcome Message and Offline Message (Messages). The other sections — Behavior, Allowed Domains, Conversation Closure and Identity Verification — can stay as they are for a first widget. The Appearance section of the widget editor: Primary Color, Header Text, Widget Logo and Widget Avatar uploads, and Enable Dark Mode Detection switched on with its three dark colours Appearance: colour, header text, logo, avatar and the dark mode colours.
  7. If only your signed-in customers should be able to chat, choose an identity verification Profile in Identity Verification; otherwise leave it on None. Identity verification.
  8. Click Create. The widget is saved with its route. If the route cannot be saved (for example your plan’s channel connections are all in use), the dialog stays open and says why; click Create again after fixing it and only the route is saved.
  9. Click Get Embed Code next to the widget and paste the snippet into your website. Until the snippet is on a page, visitors cannot see the widget. Embedding on your website.
  10. Open your site, start a chat and check it lands where you chose. Testing your widget.

After the widget exists, edit it (the pencil on the Chat Widget page) to add the Widget Logo and Widget Avatar, set its Reply and reopen settings (whether and for how long a visitor can resume an ended chat, see Conversation Closure), and switch Widget Active off or on.

While you edit, a live preview shows exactly how the widget will look — in desktop and mobile sizes, on light and dark backgrounds, and even in a live mode where messages reach a real user queue. When editing an existing widget, the Widget Active toggle marks it Active or Inactive. An inactive widget’s settings (colours, messages, placement, pre-chat form) are no longer served to visitors’ browsers and it frees its channel connection; to take the chat off your site, also remove the snippet from your pages. Switching a routed widget back on takes a channel connection, and is refused while your plan’s connections are all in use (see Plan Limits).

The Edit Widget dialog for Acme Website Chat, with the settings on the left and the live preview of the chat widget on the right Editing a widget: the live preview beside the settings shows the widget as visitors will see it.

The Chat Widget page lists every widget with its Position, Color (or “Use the brand’s colour”), Routes to (the team, the flow and the bots its steps hand to, the AI bot, or Not connected) and Status (Active or Inactive), with Get Embed Code, Edit Widget and Delete Widget actions. Above the list, the Channel Connections bar shows how many of your plan’s connections are in use. Deleting a widget asks you to confirm (“This action cannot be undone”) and removes its route too; take its snippet off your site.

Tip Create separate widgets for different pages or sections of your site (e.g., "Support Portal Chat" vs. "Sales Landing Page Chat"). Each widget has independent configuration — including its own destination — making it easy to tailor the experience by source.

Conversation Routing

The Conversation Routing section of the widget editor (“Configure where conversations from this widget are routed”) decides what answers a new chat from this widget: a team of people, a conversation flow, or an AI bot. It is the most important setting a widget has. Pick the Routing Mode, then its target:

Routing Mode Then choose Who answers first When a ticket is created Plan
Direct to Team Target Team A person on that team When the visitor sends their first message Every plan
Conversation Flow Conversation Flow (a flow you built) The flow’s steps When the flow reaches a step that creates one, such as Route to Team Plans with the flow builder and advanced routing (Professional and up)
AI Bot AI Bot (an active bot) The bot When the bot hands the chat to a person; a chat the bot resolves on its own has no ticket Every plan with AI (all current plans)

The Routing Mode list shows only the modes your plan includes. On a plan without flows, Conversation Flow is either missing or shown disabled with “The flow builder isn’t in your plan — upgrade to enable it.” or “Advanced routing isn’t in your plan — upgrade to enable it.” A route already saved keeps showing as selected. You can change the routing at any time without modifying your embed code; the next new chat uses the new destination.

The widget editor's Conversation Routing section with the routing mode list open: Direct to Team, Conversation Flow and AI Bot Conversation Routing: choose Direct to Team, Conversation Flow or AI Bot, then the target.

Direct to Team

Choose Direct to Team and a Target Team. Every new chat from the widget goes to that team, and from then on the team’s own routing settings decide who gets it.

Conversation Flow

Choose Conversation Flow and a flow from the Conversation Flow list. The list shows each flow by name; one that has never been published carries a Never published chip. With no flows it says “No published flows available. Create and publish a flow first.” The widget always runs the flow’s current published version, so republishing the flow updates the widget with no change here.

Connecting a flow to a widget counts toward your plan’s flow allowance; at the limit the save is refused and says so (see Plan Limits). Business hours for a flow-routed widget are checked inside the flow with a Schedule Condition step. Building flows is covered in Conversation Flows.

AI Bot

Choose AI Bot and a bot from the AI Bot list. Only active bots are listed; with none it says “No active bots available. Create and activate a bot in AI Settings first.”

When you save, RapiDesq checks the bot can take chats and refuses the save with the reason if it cannot: “The selected bot is not active”, “The selected bot has no AI agent”, “The selected bot’s AI agent cannot be served by any AI model” or “The selected bot no longer exists”. The bot’s replies use AI credits (see AI Credits). Setting up bots is covered in Setting Up AI.

The widget editor's Conversation Routing section with Routing Mode AI Bot and the Support bot chosen A widget routed to a bot.

No destination

A new widget starts with Direct to Team and no team chosen. If you save it that way, the editor warns “Nothing is set to receive from this widget”: its conversations arrive as unassigned tickets and nobody is notified until you choose a team, a flow or an AI bot. The visitor can still write, but nobody is offered the chat. Such tickets appear under Unrouted tickets, whose Fix it opens this widget’s settings.

The Conversation Routing section of a new widget with no target chosen, warning that nothing is set to receive from this widget A widget with no routing: the editor warns that nothing is set to receive its conversations.

Choosing a destination

When routing is not saved

Brand

If your account has two or more brands (see Multi-Brand), the Conversation Routing section also shows Brand. The chats this widget opens, and their tickets, belong to that brand; an AI bot answering them uses that brand’s knowledge bases; and a widget that uses the brand’s colour shows that brand’s colour. Leave it on the default brand if you have only one.

Note Routing to a team, a flow or a bot uses one of your plan’s channel connections per active widget; a widget with no route uses none. See the Conversation Flows guide for building flows, the AI Bots guide for setting up bots and Routing Options for how teams route.

Appearance & Theming

The Appearance section gives you control over the widget's visual presentation. All settings take effect for new visitors without any changes to your embed code.

Color and Branding

Setting Description
Use the brand’s colour On (the default for a new widget): the widget shows its brand’s colour, and follows it when the brand’s colour changes. Turn it off to choose a colour for this widget only.
Primary Color Color used for the widget header, launcher button, and interactive elements, when the widget has its own colour. Enter a hex value (such as #2E7D32) or use the color picker.
Header Text Text displayed in the widget header bar, up to 100 characters. Defaults to "Chat with us".
Position Screen corner for the widget launcher: Bottom Right (default), Bottom Left, Top Right, or Top Left. It is set in the editor’s own Position & Placement section, after Appearance (see Position & Placement).
Widget Logo An uploaded image displayed in the chat widget header. Max file size: 5MB.
Widget Avatar An uploaded image used as the default avatar for automated messages in the widget, such as a bot’s replies. Without one, a bot’s replies show the first letter of its name. Max file size: 5MB.

The logo and avatar belong to a saved widget: in Create Widget the editor says “Save the widget first, then add its logo and avatar.” and the upload buttons are disabled. The live preview shows an image once the widget is saved with it.

If a colour you choose is hard to read with any text colour, the editor warns “Some configured colors may be hard to read:” and names the colour and its contrast (below the WCAG AA minimum of 4.5:1). The warning does not stop you saving; the widget picks the more readable of light or dark text on every colour.

The widget editor's live preview switched to a dark background, showing the Acme Website Chat widget Check your colours on a dark page with the preview’s dark background.

Dark Mode

If your website supports dark mode, the widget can adapt its colors to match. Turn on Enable Dark Mode Detection — the widget then detects the visitor's browser dark-mode preference and switches automatically. Three dark mode colors are configurable:

Setting Description
Dark Primary Color The accent color used for interactive elements, links, and buttons in dark mode. This replaces the standard primary color when dark mode is active. Default #90caf9.
Dark Header Background Background color for the widget header bar in dark mode. Use a dark, low-contrast color that is visually distinct from the message area. Default #1e1e1e.
Dark Message Background Background color for the conversation body in dark mode. Should be slightly lighter than the header to create visual hierarchy. Default #333333.
Note When dark mode detection is off (the default), the widget always uses the standard primary color regardless of the visitor's system theme.

Advanced styling from your own CSS

Click Advanced: customize styling at the bottom of Appearance to see the CSS custom properties the widget exposes. The widget is namespaced under .rapidesq-widget, so your site’s stylesheet can re-theme it:

.rapidesq-widget {
  --rapidesq-color-primary: #0066cc;
  --rapidesq-color-text: #1f2937;
  --rapidesq-color-surface: #ffffff;
  --rapidesq-color-border: #e5e7eb;
}
.rapidesq-widget[data-theme="dark"] {
  --rapidesq-color-surface: #1e1e1e;
  --rapidesq-color-text: #ffffff;
}

Position & Placement

The Position & Placement section (“Control where and how the chat launcher appears on your site.”) decides where the chat button and window appear. A new widget is a bubble in the bottom-right corner that stays put while the page scrolls.

Setting What it does
Positioning ModeCorner (the default): the launcher sits in a corner of the window. Attach to element: the launcher sits next to an element of your page. Inline: the chat is drawn inside an element of your page instead of floating.
Corner, Offset X (px), Offset Y (px)Corner mode: Bottom Right, Bottom Left, Top Right or Top Left, and how far from the edges.
Element selector, Placement, AlignmentAttach to element: the CSS selector of the element (e.g. #help-button), which side of it the launcher appears on (Top, Bottom, Left, Right) and its alignment (Start, Center, End), plus offsets.
Use this element as the launcherAttach to element: hides the widget’s own bubble and opens the chat when your element is clicked — no code needed on your site.
Mount selectorInline: the CSS selector of the element the chat is drawn inside (e.g. #chat-container).
Launcher StyleBubble (default); Edge tab, a tab on the Left or Right edge with your Tab label; or Headless (custom button), no launcher at all, for a site that opens the chat from its own button (see JavaScript controls).
Scroll BehaviorFixed (default): the launcher stays in place while the page scrolls. Scroll with page: it moves with the page.
Allow user to drag the launcherLets visitors drag the launcher somewhere else; the widget remembers where in their browser.
z-indexStacking order so the widget layers correctly over your site’s elements. Raise it if a header or banner of your site covers the widget.
Respect device safe areas (notch / home indicator)Keeps the launcher clear of a phone’s notch and home indicator.
Collision avoidanceSelector to avoid: elements of your page (such as a cookie bar) the launcher moves out of the way of. Automatically avoid bottom bars: moves above bars fixed to the bottom of the page.
Mobile override“Optionally override positioning on small (mobile) viewports.” Choose another corner for phones, or Inherit from desktop. On a phone, the open chat fills the screen.

The editor’s preview shows corner and edge placements; element and inline placement attach to an element of your page that the preview does not have, so check them on your site.

Acme Outdoors' help page with the green chat button in the bottom-right corner The default launcher: a bubble in the bottom-right corner.
Tip Bottom-right is the most familiar position for live chat and is recommended unless it conflicts with other elements on your page. If you use a floating action button in the bottom-right, consider Bottom Left or a Selector to avoid to prevent overlap.

Messages

The Messages section configures the texts visitors see around the conversation:

The Messages section of the widget editor with the Welcome Message and Offline Message fields Messages: the welcome and offline texts visitors see.

The texts you write are shown as you wrote them. The widget’s built-in texts (buttons, queue messages, “Chat has ended”) are in English unless multi-language is enabled for your account; then they follow the visitor’s browser language (English, Spanish, French, German, Portuguese or Chinese).

Who the Visitor Is Speaking With

The widget names the person a visitor is chatting with by that user’s display name:

A user’s display name is their first name unless an administrator changes it, so visitors never see a last name or an email address. Administrators set it under Admin > User Management, and can let users change their own with Let users edit their own display name (off by default). A change shows on the user’s next reply, and on their earlier replies when the visitor reopens the widget. A user with no display name joins without the line, and their replies have no name above them. See Display Names.

Pre-Chat Forms

The Conversation Start section configures what happens when a visitor initiates a chat. Turn on Enable pre-chat form (off by default) to collect contact information before the conversation begins. This gives your users context and populates the contact record automatically. The visitor sees “Before we begin — Please provide your contact information”, your fields, and Start Chat.

Standard Fields

The pre-chat form offers four built-in fields. Each can be independently shown or hidden, and each shown field can be marked as Required:

The Conversation Start section of the widget editor with Enable pre-chat form on, the Name, Email, Phone and Company fields each shown or hidden and required or optional, and an Order number custom data field added Conversation Start: turn on the pre-chat form, choose its fields and add your own.

Custom data fields

The pre-chat form is not limited to contact details. Below the standard fields, Custom data fields lets the form “Ask for information from your account’s custom data fields. Answers are saved on the ticket the chat creates, so users can see, filter and report on them.” Choose a field in Add a field and click Add; then mark it Required, reorder it with Move up / Move down, or Remove from this form. Without any, the section says “This form only asks for contact details. Add a custom data field to collect anything else.”

Show widget greeting before the flow runs

For a widget routed to a Conversation Flow. Off (the default): the flow’s first step speaks first and the widget’s Welcome Message is skipped. On: the Welcome Message is shown first, then the flow starts. It has no effect on widgets routed to a team or a bot.

Note The pre-chat form asks once, before the chat. To ask questions that depend on earlier answers, use a Web Form, or route the widget to a Conversation Flow that asks them in the chat itself.
Tip Keep pre-chat forms short. Every additional required field adds friction that may cause visitors to abandon the chat. Email is usually the one field worth requiring, since it links the conversation to a contact record.

Behavioral Settings

The Behavior section controls how the widget behaves during and around conversations.

The Behavior section of the widget editor: Auto-open Delay, Show typing indicator, the Bot Typing Delay slider, Show user avatar, Enable file uploads and Enable emoji picker Behavior: the settings described below, in one section.

Auto-Open Delay

The Auto-open Delay (seconds) setting causes the widget to open automatically after the visitor has been on the page for the specified number of seconds. This can increase engagement by proactively offering help. Leave the field empty (the default) to disable auto-open so the visitor must click the launcher.

Note Use a moderate delay (5–15 seconds) to avoid interrupting visitors who are still orienting themselves on the page.

Typing Indicators

When Show typing indicator is enabled (the default), visitors see an animated typing indicator while a user composes a response. This reduces perceived wait time and reassures the visitor that their message is being addressed.

Bot Typing Delay

The Bot Typing Delay slider (0–5 seconds, in quarter-second steps, default 1.5 seconds) controls how long a typing indicator is shown before automated messages — flow steps and bot replies — are displayed. A short delay makes automated responses feel more natural. Set it to 0 for instant delivery.

User Avatars

Enable Show user avatar (on by default) to display the user's profile picture next to their messages in the conversation. This adds a personal touch and helps visitors feel they are talking to a real person.

File Uploads

The Enable file uploads toggle (off by default) controls whether visitors can attach files (screenshots, documents, etc.) to their messages. When enabled, a file-attachment button appears in the message input area. Every file is scanned for viruses; the visitor sees “Scanning for viruses…” and then “File verified”. Size limits and allowed types are in File Attachments.

Emoji Picker

When Enable emoji picker is on (the default), an emoji picker button appears alongside the message input, allowing visitors to insert emoji into their messages.

Conversation Closure

What happens when conversations end is set in two places:

When a chat ends, the visitor sees “Chat has ended” in place of the message box and a Start new chat button, plus Reopen Chat while the chat can still be resumed. Visitors can end a chat themselves with End Chat in the header, after confirming “Are you sure you want to end this conversation?”. If you collect satisfaction surveys, the widget can ask for a rating when the chat ends (see CSAT).

The Conversation Closure section of the widget editor with the Default Close Message field and a note that resuming an ended chat is set in Reply and reopen Conversation Closure holds the close message; resuming an ended chat is set in Reply and reopen. The Reply and reopen settings at the bottom of the Edit Widget dialog, including how long a contact may resume an ended conversation Reply and reopen, below the widget’s settings: whether and for how long a contact can resume an ended chat.
Tip Letting contacts resume an ended conversation for a reasonable time (30–60 minutes) is recommended. It prevents the frustrating experience of a visitor needing to repeat themselves when they have a quick follow-up question after a conversation is closed.

Bot Resolution Feedback

When an AI bot resolves a conversation without escalating to a human, the widget shows the visitor a quick thumbs up / thumbs down prompt asking whether the answer was helpful. The feedback is recorded against the conversation so you can monitor how well your bots are performing.

Embedding on Your Website

After configuring your widget, embed it on your site by adding the script tag to your HTML.

Getting the Embed Snippet

On the Chat Widget page, click the Get Embed Code action next to your widget. A dialog opens showing the snippet for that widget, along with a copy button and a reminder of any domain list. The snippet looks like this:

<link rel="preconnect" href="https://<your-rapidesq-host>">
<link rel="preconnect" href="https://<your-rapidesq-host>" crossorigin>
<link rel="preconnect" href="https://<your-rapidesq-api-host>" crossorigin>
<script
  src="https://<your-rapidesq-host>/widget.js"
  data-widget-id="YOUR_WIDGET_ID"
  data-api-url="https://<your-rapidesq-api-host>"
  data-tenant-id="YOUR_TENANT_ID"
  async>
</script>

The dialog generates the snippet with your real widget ID, tenant ID, and hosts filled in — just copy and paste. Place the snippet just before the closing </body> tag on every page where you want the widget to appear. The async attribute ensures the script loads without blocking page rendering — your page content loads first, and the widget initializes in the background.

The Embed Code dialog for Acme Website Chat: the snippet with a copy button, the reminder that the widget is restricted to acmeoutdoors.com, and the identity verification instructions Get Embed Code: copy the snippet; the dialog also lists your allowed domains and identity verification instructions.

Keep the <link rel="preconnect"> lines: they let the browser open its connections to the widget and API hosts while the rest of your page loads, instead of after it reaches the script tag. They are equally fine in your page's <head>.

Two optional attributes can be added to the <script> tag:

Full Page Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>My Website</title>
</head>
<body>
  <!-- Your page content -->
  <h1>Welcome to our site</h1>

  <!-- RapiDesq Chat Widget — place just before </body> -->
  <script
    src="https://<your-rapidesq-host>/widget.js"
    data-widget-id="abc123-def456-ghi789"
    data-api-url="https://<your-rapidesq-api-host>"
    data-tenant-id="tenant-id-here"
    async>
  </script>
</body>
</html>

How the Widget Loads

  1. widget.js is a small loader. Its address never changes, so you never re-paste the snippet after a new release.
  2. The loader fetches a small launcher bundle, which draws the chat button.
  3. The full chat window loads when the visitor opens the chat, or once your page has finished loading and the browser is idle, whichever comes first. A page where nobody opens the chat downloads the button and little else. The open chat window headed Chat with Acme Outdoors, showing the pre-chat form asking for the visitor's name and email The chat window, opened from the button.

If the chat window cannot be downloaded (a network failure or a blocked host), the button stays on the page and offers a Retry instead of doing nothing. Settings you change in the editor reach visitors within about 30 seconds, with no change to the snippet.

JavaScript controls

Once the script has loaded, window.ContactCenterWidget offers a few calls for your own page code. The widget announces it is ready with the rapidesq:widget-ready event on window.

<button id="chat-button">Chat with us</button>
<script>
  document.getElementById('chat-button').addEventListener('click', function () {
    if (window.ContactCenterWidget) {
      window.ContactCenterWidget.open();
    }
  });
</script>

Content Security Policy

If your site sends a Content Security Policy, allow:

Allowed Domains

The Allowed Domains section (“Restrict widget embedding to specific domains. Leave empty to allow all domains.”) records the websites a widget is meant for. Type a domain such as example.com in Domain and click +; each domain shows as a chip you can remove with its ×. Domains are up to 255 characters each.

The Allowed Domains section of the widget editor with acmeoutdoors.com added to the list Allowed Domains with acmeoutdoors.com added.
Important The widget ID in your snippet is public: anyone who views your page source can see it. When chats must come only from your own signed-in customers, turn on Identity Verification; a visitor without a valid token signed by your server cannot start a chat.

Identity Verification

Identity verification lets you confirm the identity of logged-in visitors so your users can trust that the person chatting is who they claim to be. This is essential for support scenarios involving account-specific information, billing, or sensitive data — and it ensures verified visitors are matched to the right contact record reliably.

How It Works

Identity verification uses public-key signed tokens: your backend signs a short token for each logged-in user with a private key that only you hold, and RapiDesq verifies the signature using the public key you provide. RapiDesq never holds your signing key.

  1. Add an identity verification profile under Admin > Channels > Identity Verification with Add profile, and give it a name. One profile can serve many widgets.
  2. Choose a signing algorithm — RSA (RS256/RS384/RS512), ECDSA (ES256/ES384/ES512), or EdDSA. RS256 is the default and works with standard JWT libraries.
  3. Paste your public key in PEM format into Public key (PEM). You keep the matching private key on your server. The identity verification profile dialog under Admin, Identity Verification: the name Acme website login, Signing Algorithm RS256 and a pasted PEM public key The signing algorithm and public key are set on a profile under Admin > Identity Verification.
  4. Choose the profile in the widget's Identity Verification section, under Profile. From then on every visitor must present a valid token to start a chat. Choosing or changing the profile needs the Manage identity profiles permission; without it the editor says so. With no profiles yet, it says “No identity verification profiles yet. Add one under Admin → Channels → Identity Verification, then choose it here.” Manage profiles opens that page. The Identity Verification section of the widget editor with the Acme website login identity verification profile selected, and its claim mappings The widget’s Identity Verification section: pick the identity verification profile it uses.
  5. Your backend generates a signed token whenever a logged-in user loads a page with the widget. The token carries the visitor's identity claims.
  6. Pass the token to the widget (see below). When the visitor starts a conversation, RapiDesq verifies the signature and attaches the verified identity to the conversation.

A visitor whose page gives no token, or a token that does not verify, sees “Chat is unavailable right now. Please try again later.” and cannot start a chat.

Token Claims

The token's email claim is required — it identifies the contact. Optional claims include externalId, name, firstName, lastName, and a customFields object. You can also configure Claim Mappings in the widget editor (“Map JWT claims to contact fields, custom fields, or rate limit tiers.”) once the widget is saved: Add Mapping, enter the Claim Path (dot notation for nested claims, e.g. metadata.plan), and choose the Target Type (Contact Field, Custom Field or Rate Limit Tier) and Target Value.

Backend Example (Node.js)

const jwt = require('jsonwebtoken');
const fs = require('fs');

// Your private key — RapiDesq only ever sees the public key.
const privateKey = fs.readFileSync('private-key.pem');

const token = jwt.sign(
  { email: 'user@example.com', name: 'John Doe' },
  privateKey,
  { algorithm: 'RS256', expiresIn: '5m' }
);

Passing the Token to the Widget

Give the widget a function that fetches a fresh token from your server. The widget calls it before every connection and reconnection, so a short-lived token never goes stale. Add data-identity-provider="host" to the snippet’s <script> tag so the first connection waits for your function (for at most ten seconds), then register it:

function registerTokenProvider() {
  window.ContactCenterWidget.setIdentityTokenProvider(function () {
    // Your own endpoint that returns the signed token as text.
    return fetch('/chat-identity-token', { credentials: 'include' })
      .then(function (response) { return response.ok ? response.text() : null; });
  });
}
if (window.ContactCenterWidget) {
  registerTokenProvider();
} else {
  window.addEventListener('rapidesq:widget-ready', registerTokenProvider);
}

When a widget has an identity verification profile, the embed code dialog includes “Identity verification is enabled for this widget. Contacts must provide a signed JWT token.”, the claim reference, and a signing code sample.

Important Your private key must never be exposed in client-side JavaScript. Always generate the signed token on your server and pass only the token to the frontend. Because RapiDesq stores only the public key, your signing material cannot be forged even if widget configuration were exposed.
Note Identity verification is optional. With the widget’s Profile left on None (“anonymous visitors allowed”), visitors chat anonymously or provide their details through the pre-chat form.

Business Hours

Widgets do not carry their own schedule. Business-hours behavior comes from where the widget's conversations are routed:

Note See Business Hours & Schedules for creating schedules, holiday exceptions, and applying schedules to teams and flows.

Permissions and Plan Availability

Testing Your Widget

Thorough testing ensures your visitors have a smooth experience. The widget editor's built-in preview covers most visual checks — it renders desktop and mobile sizes (375×667), light and dark backgrounds, a visual mode with sample messages, and a live mode that sends real messages to your user queue (“Live mode: Messages will be sent to a real user queue”). A widget with no routing says “No routing configured” in live mode. Changing routing, flows or behavior while live asks you to Apply Changes, which saves the widget and starts a new preview conversation. Reset preview starts over; Open in New Tab opens the preview on its own. After embedding, work through the following scenarios on your actual site.

Basic Functionality

  1. Open your website in a browser and confirm the widget launcher icon appears in the configured position.
  2. Click the launcher. Verify the header text and welcome message display correctly.
  3. If the pre-chat form is enabled, fill it in and confirm required fields are enforced. The chat widget's pre-chat form filled in with the name Sam Rivera and the email sam.rivera@example.com The pre-chat form, filled in by a visitor.
  4. Send a test message and confirm it reaches the destination you chose: an offer to a user on the team, the flow’s first step, or the bot’s reply.
  5. Reply from the RapiDesq side and verify the response appears in real time in the widget.

Feature-Specific Checks

Cross-Browser and Device Testing

Verify the widget renders and functions correctly on:

Important Always test both online and offline user states. If you have configured identity verification, test with valid tokens, expired tokens, and no token to ensure each scenario is handled gracefully.

Troubleshooting

What you see Likely cause What to do
Chats arrive but nobody is offered them; the list shows Not connectedThe widget has no destinationEdit the widget and choose a team, flow or bot under Conversation Routing (see No destination). Waiting tickets are in Unrouted tickets.
Chats wait in the queue and are never offeredNobody on the team is available, has capacity, or the team uses Manual QueueCheck the team’s users’ statuses and capacity and its Assignment Mode (see Routing Strategies).
A flow-routed widget greets normally and visitors get “Sorry, no one is available to help right now.”The flow has no published versionPublish the flow, or choose another destination.
The flow runs but the ticket never reaches a teamA path of the flow ends without Route to TeamGive every path a Route to Team step (see Unrouted tickets).
The bot never hands offThe bot has no hand-off rules, or its master switch is offSet its Escalation tab (see AI Bots).
The AI Bot or Conversation Flow mode is missing or disabledYour plan does not include it, or no bot is active / no flow existsSee Permissions and Plan Availability; activate a bot or create and publish a flow.
Saving says the routing configuration could not be savedUsually the channel connection or flow allowance is fullFree a connection or add capacity (see Plan Limits), then save again.
Visitors see “Chat is unavailable right now. Please try again later.”Identity verification is on and the page gave no valid token, or the widget was deletedCheck your token endpoint and the profile’s public key and algorithm; check the widget ID in the snippet.
The launcher does not appearThe snippet is missing from the page, your Content Security Policy blocks the hosts, or the launcher is headless or attached to an element the page lacksCheck the snippet, your CSP and Position & Placement.
The Offline Message never appearsThe widget routes to a flow or bot, or the team has no scheduleIt shows only for Direct to Team with a scheduled team (see Business Hours).
The logo and avatar uploads are disabledThe widget is not saved yetCreate the widget, then edit it to upload.
A change to the widget does not show on your siteVisitors’ browsers keep the settings for about 30 secondsWait a minute and reload the page.

Worked Example: Acme Outdoors’ First Website Chat

Acme Outdoors wants a chat bubble on its help pages that reaches the Customer Success team, and wants every chat to become a ticket with the customer’s name on it. A person should answer every chat, so the widget routes Direct to Team.

  1. Open Admin > Channels > Chat Widget and click Guided Setup. On the Name step, call the widget “Acme Website Chat” and set the Header Text to “Chat with Acme Outdoors”. Guided Setup's Name step: the widget name Acme Website Chat, the Header Text Chat with Acme Outdoors and the Welcome Message The Name step, which also holds the Header Text and Welcome Message.
  2. On the Appearance step, set the Primary Color to Acme’s green. Leave the pre-chat form on: it asks the visitor for their name and email before the chat starts.
  3. On the Conversation Routing step, choose Direct to Team and the team Customer Success. Check the Review & Confirm step and create the widget. Guided Setup's Conversation Routing step with Routing Mode Direct to Team and the team Customer Success Direct to Team, on Customer Success. Guided Setup's Review & Confirm step summarising the widget Acme Website Chat routed to Customer Success, with the Create button Review & Confirm, then Create.
  4. Click Get Embed Code, copy the snippet, and paste it just before </body> on the help pages of www.acmeoutdoors.com. Click Done. The widget is listed on the Chat Widget page, Routes to Customer Success; its Get Embed Code action shows the same snippet again later. The Embed Code dialog opened from the finished Guided Setup, showing the snippet for Acme Website Chat with a copy button The snippet to paste into your help pages. The Chat Widget admin page listing Acme Website Chat, routed to Customer Success, with its Get Embed Code, edit and delete actions The widget on the Chat Widget page.
  5. A visitor on the help page opens the bubble, enters “Sam Rivera” and their email, and writes “My parcel has not arrived”. That first message creates the ticket on Customer Success.
  6. An available user on Customer Success is offered the chat and clicks Accept. They reply “Sorry about that, it ships today”; Sam reads the reply in the widget and answers. The chat offer dialog in RapiDesq for Sam Rivera's chat, with its countdown and the Accept and Decline buttons The offer, as it reaches an available user on Customer Success.
  7. In the user’s ticket list the chat is a ticket named after Sam Rivera, on Customer Success and assigned to them, with the whole conversation on it. Sam’s email links it to the contact record. The Tickets page with Sam Rivera's chat open as a ticket on Customer Success, showing the whole conversation The chat as a ticket, with the whole conversation on it.

To make email required, or to ask for a phone number too, edit the widget and change the fields in its Conversation Start section. To have a bot answer first, switch its Routing Mode to AI Bot. The snippet on your site does not need to change.

Configuration Reference

A summary of the widget editor's settings, grouped by section, with defaults.

Setting Section Description
Widget NameGeneralInternal label for the widget, up to 100 characters. Required.
Widget ActiveGeneralEnable or disable the widget (edit mode). On by default.
Routing Mode / TargetConversation RoutingDirect to Team (Target Team), Conversation Flow (a flow), or AI Bot (an active bot). No target = nothing receives the chats.
BrandConversation RoutingThe brand the chats belong to; shown with two or more brands.
Use the brand’s colour / Primary ColorAppearanceFollow the brand’s colour (default) or set a hex colour for the header, launcher, and accents.
Header TextAppearanceHeader bar text, up to 100 characters. Default "Chat with us".
Widget LogoAppearanceUploaded image shown in the widget header (after saving; max 5MB).
Widget AvatarAppearanceUploaded default avatar for automated messages (after saving; max 5MB).
Enable Dark Mode DetectionAppearanceFollow the visitor's browser dark-mode preference. Off by default.
Dark Primary Color / Dark Header Background / Dark Message BackgroundAppearanceThe dark-mode color set. Defaults #90caf9, #1e1e1e, #333333.
Positioning ModePosition & PlacementCorner (default), Attach to element, or Inline.
Corner / Offset X / Offset YPosition & PlacementBottom Right (default), Bottom Left, Top Right, or Top Left, and offsets in pixels.
Element selector / Placement / Alignment / Use this element as the launcherPosition & PlacementAttach the launcher to an element of your page, or use it as the launcher.
Mount selectorPosition & PlacementInline: the element the chat is drawn inside.
Launcher StylePosition & PlacementBubble (default), Edge tab (edge and tab label), or Headless (custom button).
Scroll BehaviorPosition & PlacementFixed (default) or Scroll with page.
Allow user to drag the launcher / z-index / Respect device safe areasPosition & PlacementDragging, stacking order and phone safe areas. Off / empty by default.
Collision avoidance / Mobile overridePosition & PlacementSelectors to avoid, avoid bottom bars, and a corner for phones (default Inherit from desktop).
Welcome MessageMessagesGreeting when a new chat opens. Default "Hello! How can we help you today?".
Offline MessageMessagesShown while a Direct to Team widget’s team is outside its hours. Default "We are currently offline. Please leave a message.".
Enable pre-chat formConversation StartCollect contact information before the chat begins. Off by default.
Standard Fields (Name, Email, Phone, Company)Conversation StartEach field independently shown and optionally required.
Custom data fieldsConversation StartYour ticket custom fields, saved on the chat’s ticket; each optionally required.
Show widget greeting before the flow runsConversation StartFlow-routed widgets only. Off by default.
Auto-open Delay (seconds)BehaviorOpen automatically after a delay; empty (default) disables.
Show typing indicatorBehaviorShow a typing indicator while the user types. On by default.
Bot Typing DelayBehaviorTyping-indicator duration before automated messages (0–5s, default 1.5s).
Show user avatarBehaviorDisplay user profile pictures. On by default.
Enable file uploadsBehaviorAllow visitors to attach files. Off by default.
Enable emoji pickerBehaviorShow an emoji picker in the message input. On by default.
Allowed DomainsAllowed DomainsThe domains the widget is meant for; listed in the embed code dialog.
A contact may resume an ended conversation forReply and reopenHow long a contact can continue an ended chat, or never (edit mode).
Default Close MessageConversation ClosureShown when a user closes without a custom message, up to 500 characters.
ProfileIdentity VerificationThe identity verification profile visitors’ signed tokens are checked against; None allows anonymous visitors.
Algorithm / Public key (PEM)Admin > Channels > Identity VerificationSet on the profile: RSA, ECDSA, or EdDSA; you paste only the public key.
Claim MappingsIdentity VerificationMap token claims to contact fields, custom fields or rate limit tiers (after saving).