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:
- Single script tag deployment — embed one
<script>tag and the widget loads asynchronously without blocking page rendering. - Real-time communication — messages, typing indicators, and status updates are exchanged over a persistent connection for instant delivery.
- Extensive configuration — control appearance, behavior, pre-chat forms, routing, and security from the admin portal without ever touching your embed code.
- Flexible routing — send new conversations directly to a team, through a conversation flow, or to an AI bot (see Conversation Routing).
- Dark mode support — a dedicated dark-mode color set that follows the visitor's browser preference.
- Pre-chat data collection — gather the visitor's name, email, phone, company and your own custom data fields before the conversation begins.
- Identity verification with signed tokens — verify logged-in visitors' identities so users know exactly who they are talking to.
- Custom branding — upload a widget logo and avatar image in addition to color theming, or follow your brand’s colour.
- Flexible placement — a corner bubble, an edge tab, your own button, a launcher attached to an element of your page, or the chat drawn inside your page.
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.
- 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.
- 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.
- 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.
Create Widget: name the widget, choose where its chats go, then open each section you want to change.
- 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.
- 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.
- 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.
Appearance: colour, header text, logo, avatar and the dark mode colours.
- 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.
- 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.
- 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.
- 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).
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.
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.
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.
- What the visitor sees: the Welcome Message as soon as the chat opens, as an automated message. Their first message creates the ticket. While nobody has taken the chat yet, the widget can show their place in the queue (“You are #2 in queue”), an estimated wait and a wait message, depending on the team’s Queue settings. When a person accepts, the widget says “You’re now speaking with Priya.” (see Who the Visitor Is Speaking With). If the team has a schedule and is outside it, the widget shows your Offline Message above the chat (see Business Hours).
- What your team sees: a ticket on the team, labelled Chat, named after the visitor and holding the conversation. How it reaches a person depends on the team’s Assignment Mode: in Offer mode available users get a New Chat Request with a countdown and Accept / Decline; in Auto-Assign mode it is assigned straight to a user; in Manual Queue it waits in the team’s queue until someone takes it. With nobody available it waits in the queue.
- Rules that can move it: the team’s after-hours, overflow and queue-alternative rules can send the chat to another team, a flow or a bot, or send a message and close it (see Team Routing Rules). A queue alternative appears in the widget as an offer such as “Our team is busy. Would you like to talk to Billing instead?” with Yes, please and No, I will wait.
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.
- What the visitor sees: the flow starts as soon as the chat opens; the visitor does not have to type first. The flow’s first step speaks first, and by default the widget’s own Welcome Message is not shown (turn on Show widget greeting before the flow runs to show it first). The flow can then send messages, ask questions with buttons or inline forms (the message box then reads “Choose an option above”), branch on the answers or on your hours, hand the visitor to an AI bot in a Bot Conversation step, and finally route the chat to a team.
- What your team sees: nothing until the flow creates a ticket, usually at its Route to Team step, which also offers the chat to that team as in Direct to Team. Answers the flow collected are on the ticket. A flow that never puts the ticket on a team leaves it in Unrouted tickets.
- Bots inside the flow: when the chosen flow’s published version hands visitors to a bot, the editor says which: “In this flow, these bots answer: Acme Assistant (step "Product questions")”, and the Chat Widget list shows the flow “answered by” those bots.
- If the flow cannot run (it was never published, or was unpublished or deleted), the widget behaves as a normal chat with its Welcome Message, and a visitor who writes is told “Sorry, no one is available to help right now. Please try again later.” Publish the flow or choose another destination.
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.”
- What the visitor sees: a note that the bot is an AI (“Acme Assistant is an AI assistant.”), then the bot’s own greeting (or, if the bot has none, the widget’s Welcome Message) under the bot’s name with an AI label. The bot answers from your knowledge bases, with Sources where it used them, and the widget’s Widget Avatar beside its replies. When the bot hands off, the visitor sees “I’m connecting you with a team member.” and then “You’re now speaking with …” when a person accepts. When the bot resolves the chat on its own, the visitor is asked whether the answer helped (see Bot Resolution Feedback).
- What your team sees: nothing while the bot is answering. When the bot hands off, a ticket is created on the bot’s Escalation Team with the whole conversation, and offered like any team chat. Chats the bot resolved on its own have no ticket; read them in Conversations and follow live ones on the supervisor dashboard’s Bot tab (see AI Oversight).
- When it hands off: only for the reasons you set on the bot’s Escalation tab; a bot with no hand-off rules never hands off (see When the Chatbot Hands Off to a Person). A bot cannot be activated without an escalation team.
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.
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.
A widget with no routing: the editor warns that nothing is set to receive its conversations.
Choosing a destination
- Your team answers every chat during known hours — Direct to Team, with a schedule on the team and its after-hours rule for the rest.
- Chats need sorting first (by product, language or type of request) or you want details collected in the conversation — Conversation Flow, ending in Route to Team steps for each case.
- Most questions are answered in your knowledge base — AI Bot, with hand-off rules for what needs a person.
- A bot for some visitors and a person for others — Conversation Flow with a Bot Conversation step on one path and Route to Team on another.
- Different pages need different answers — create one widget per page or section, each with its own destination.
When routing is not saved
- “Choose a flow, or switch the routing mode. Nothing was saved.” / “Choose an AI bot, or switch the routing mode. Nothing was saved.” — a mode was chosen without its target.
- “Widget was saved successfully, but the routing configuration could not be saved.” followed by the reason — the widget exists but has no route yet. The reason may be a plan limit (“Your plan plan includes N channel connections and all of them are in use.”). The dialog stays open; fix the cause and save again.
- “Could not save the team assignment” — when editing: “Your widget name and other settings saved successfully — only the team assignment didn’t.” Retry from the message.
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.
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.
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. |
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 Mode | Corner (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, Alignment | Attach 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 launcher | Attach to element: hides the widget’s own bubble and opens the chat when your element is clicked — no code needed on your site. |
| Mount selector | Inline: the CSS selector of the element the chat is drawn inside (e.g. #chat-container). |
| Launcher Style | Bubble (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 Behavior | Fixed (default): the launcher stays in place while the page scrolls. Scroll with page: it moves with the page. |
| Allow user to drag the launcher | Lets visitors drag the launcher somewhere else; the widget remembers where in their browser. |
| z-index | Stacking 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 avoidance | Selector 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.
The default launcher: a bubble in the bottom-right corner.
Messages
The Messages section configures the texts visitors see around the conversation:
- Welcome Message — a greeting shown when the visitor opens a new chat, up to 5,000 characters. Defaults to "Hello! How can we help you today?" (Guided Setup suggests "Hi! How can we help you today?"). On a Direct to Team widget it is shown as an automated message. On an AI Bot widget the bot’s own greeting is shown instead, and this text only when the bot has none. On a Conversation Flow widget it is not shown unless Show widget greeting before the flow runs is on. A visitor who comes back to an existing chat is not greeted again.
- Offline Message — text shown above the chat while the team a Direct to Team widget routes to is outside its business hours (e.g., "We are currently offline. Please leave a message.", the default), up to 5,000 characters. Visitors can still write; what happens to their chat is set by the team’s after-hours rule. It is never shown for a widget routed to a flow or a bot, or to a team with no schedule; clear the field to show nothing. See Business Hours.
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:
- When a person joins — each time the chat is assigned to a user, including a transfer to someone else, the widget shows a short centred line: “You’re now speaking with Priya.” It is written in the visitor’s language and stays in the conversation, so it is still there when the visitor reopens the widget, with the name the user had at the time.
- Above each reply — every reply from a user is headed with their display name, in the same place and style as the bot’s name on a bot’s replies.
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:
- Name — the contact's full name.
- Email — the contact's email address. Used to match or create a contact record.
- Phone — the contact's phone number.
- Company — the contact's company or organization.
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.”
- Which fields are offered: fields from your account’s custom data library (see Custom Fields) that are active and apply to tickets, or to both tickets and contacts. A pre-chat form can ask for these types: Text, Email, Phone, Select from List, Number, Text Area and Checkbox. File Upload fields are not offered (the form is shown before the conversation exists, so there is nowhere to send a file), and neither are fields that apply to contacts only. With no field that qualifies, the list says “No custom data field can be used here yet. A pre-chat form can ask for ticket fields, and not for file uploads.”; once every qualifying field is on the form it says “Every eligible field is already on this form.”
- Where the answers go: each answer is saved on the ticket the chat creates, in that field, alongside what a web form collects for the same field. Your team sees it in the ticket’s custom fields and can filter and report on it.
- Limits and checks: each field can be on the form once. A field that is later deleted, deactivated or changed to a type the form cannot show simply disappears from the form visitors see. Saving the widget while it still names an inactive field is refused with “Reactivate the field or remove it from the form.”
- Plans: the custom data library is managed on the Custom Data page, which is on the Professional plan and up; without it there are no fields to add.
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.
Behavioral Settings
The Behavior section controls how the widget behaves during and around conversations.
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.
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:
- Default Close Message, in the Conversation Closure section — shown to the contact when a user closes the conversation without writing a custom closing message. Up to 500 characters; defaults to “This conversation has been closed. Thank you for contacting us.”
- A contact may resume an ended conversation for, in the widget’s Reply and reopen settings below its other settings when you edit it — an amount in minutes, hours or days, or Never resume an ended conversation. Within this time a contact who comes back continues the same conversation; after it they start a new one. A new widget starts with your Reply and reopen template. The same settings decide what a reply to a resolved or closed ticket does and who a reopened ticket goes to; see Ticket Workflows.
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).
Conversation Closure holds the close message; resuming an ended chat is set in Reply and reopen.
Reply and reopen, below the widget’s settings: whether and for how long a contact can resume an ended chat.
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.
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:
data-launcher-wait-for-config="true"— on a visitor’s first visit, draw nothing until the widget’s saved placement is known, instead of a default bubble that may then move. Useful with an edge tab, a headless launcher or element placement.data-identity-provider="host"— your page will hand the widget an identity token callback (see Passing the Token to the Widget).
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
widget.jsis a small loader. Its address never changes, so you never re-paste the snippet after a new release.- The loader fetches a small launcher bundle, which draws the chat button.
- 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 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.
window.ContactCenterWidget.open()— open the chat, for example from your own “Chat with us” button when the Launcher Style is Headless (custom button).open({ anchorTo: '#my-button' })opens it next to that element this once.window.ContactCenterWidget.close()— close the chat window.window.ContactCenterWidget.setPosition('bottom-left')— move the launcher for this page view; an object such as{ corner: 'TOP_RIGHT' }changes only the settings it names.window.ContactCenterWidget.setIdentityTokenProvider(fn)— see Passing the Token to the Widget.
<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:
script-src: the widget host from your snippet. The launcher and the chat window are JavaScript modules served from it.connect-src: the API host from your snippet, as bothhttps://andwss://.
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 Get Embed Code dialog repeats the list (“This widget is restricted to the following domains: …”), so whoever installs the snippet knows where it belongs.
- Today the chat service does not compare the address of the page that loads the widget with this list, so the list does not stop a copied snippet from working on another site.
Allowed Domains with acmeoutdoors.com added.
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.
- Add an identity verification profile under Admin > Channels > Identity Verification with Add profile, and give it a name. One profile can serve many widgets.
- Choose a signing algorithm — RSA (RS256/RS384/RS512), ECDSA (ES256/ES384/ES512), or EdDSA. RS256 is the default and works with standard JWT libraries.
- Paste your public key in PEM format into Public key (PEM). You keep the matching private key on your server.
The signing algorithm and public key are set on a profile under Admin > Identity Verification.
- 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 widget’s Identity Verification section: pick the identity verification profile it uses.
- 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.
- 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.
Business Hours
Widgets do not carry their own schedule. Business-hours behavior comes from where the widget's conversations are routed:
- Direct to Team — assign a schedule to the team that receives the widget's conversations. While the team is outside its schedule, the widget shows its Offline Message above the chat, and the team’s after-hours rule decides what happens to the chat (queue it for the morning, send it to another team, a flow or a bot, or send a message, create a ticket and close).
- Conversation Flow — use a Schedule Condition step to branch between an in-hours path (route to a team) and an out-of-hours path (collect details, set expectations). The widget’s Offline Message is not shown.
- AI Bot — the bot answers at any hour; a hand-off goes to its escalation team, whose own schedule and rules then apply.
Permissions and Plan Availability
- Chat Widgets permissions: View to see widgets, their embed code and the preview; Create, Edit and Delete for those actions. The built-in Widget Administrator role holds them (see Permissions).
- Channel Routing permissions: Create and Edit to set or change where a widget routes.
- Manage identity profiles: to choose or change a widget’s identity verification profile.
- Plans: widgets and Direct to Team routing are on every plan, and so is AI Bot routing. Conversation Flow routing needs the flow builder and advanced routing, on Professional and up; so do custom data fields on the pre-chat form. Brands are on Enterprise.
- Limits: you can create as many widgets as you like; each active widget with a route uses one channel connection, and a widget routed to a flow also counts that flow toward your flow allowance (see Plan Limits).
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
- Open your website in a browser and confirm the widget launcher icon appears in the configured position.
- Click the launcher. Verify the header text and welcome message display correctly.
- If the pre-chat form is enabled, fill it in and confirm required fields are enforced.
The pre-chat form, filled in by a visitor.
- 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.
- Reply from the RapiDesq side and verify the response appears in real time in the widget.
Feature-Specific Checks
- Auto-open: navigate to the page and wait for the configured delay. Verify the widget opens automatically.
- Typing indicators: have a user begin typing and confirm the typing indicator appears in the widget.
- File uploads: attach a file from the widget and confirm it arrives on the user side.
- Resume: close a conversation, then come back to it within the resume time set in Reply and reopen. Verify the conversation history is preserved.
- Dark mode: toggle your browser or OS to dark mode and confirm the widget colors switch to the configured dark-mode values.
- Routing: verify conversations land where you expect — the team queue, the first flow step, or a bot reply — and, for a bot, that asking for a person hands the chat to its escalation team.
- Out of hours: for a team with a schedule, test outside its hours and check the Offline Message and the after-hours rule.
- Identity verification: if enabled, verify that an authenticated visitor's name and email appear correctly on the user side, and test the experience with no token and with an invalid token.
Cross-Browser and Device Testing
Verify the widget renders and functions correctly on:
- Desktop browsers: Chrome, Firefox, Safari, and Edge.
- Mobile browsers: iOS Safari and Android Chrome.
- Tablet devices in both portrait and landscape orientation.
Troubleshooting
| What you see | Likely cause | What to do |
|---|---|---|
| Chats arrive but nobody is offered them; the list shows Not connected | The widget has no destination | Edit 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 offered | Nobody on the team is available, has capacity, or the team uses Manual Queue | Check 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 version | Publish the flow, or choose another destination. |
| The flow runs but the ticket never reaches a team | A path of the flow ends without Route to Team | Give every path a Route to Team step (see Unrouted tickets). |
| The bot never hands off | The bot has no hand-off rules, or its master switch is off | Set its Escalation tab (see AI Bots). |
| The AI Bot or Conversation Flow mode is missing or disabled | Your plan does not include it, or no bot is active / no flow exists | See Permissions and Plan Availability; activate a bot or create and publish a flow. |
| Saving says the routing configuration could not be saved | Usually the channel connection or flow allowance is full | Free 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 deleted | Check your token endpoint and the profile’s public key and algorithm; check the widget ID in the snippet. |
| The launcher does not appear | The 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 lacks | Check the snippet, your CSP and Position & Placement. |
| The Offline Message never appears | The widget routes to a flow or bot, or the team has no schedule | It shows only for Direct to Team with a scheduled team (see Business Hours). |
| The logo and avatar uploads are disabled | The widget is not saved yet | Create the widget, then edit it to upload. |
| A change to the widget does not show on your site | Visitors’ browsers keep the settings for about 30 seconds | Wait 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.
- 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”.
The Name step, which also holds the Header Text and Welcome Message.
- 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.
- On the Conversation Routing step, choose Direct to Team and the team Customer Success. Check the Review & Confirm step and create the widget.
Direct to Team, on Customer Success.
Review & Confirm, then Create.
- Click Get Embed Code, copy the snippet, and paste it just before
</body>on the help pages ofwww.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 snippet to paste into your help pages.
The widget on the Chat Widget page.
- 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.
- 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 offer, as it reaches an available user on Customer Success.
- 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 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 Name | General | Internal label for the widget, up to 100 characters. Required. |
| Widget Active | General | Enable or disable the widget (edit mode). On by default. |
| Routing Mode / Target | Conversation Routing | Direct to Team (Target Team), Conversation Flow (a flow), or AI Bot (an active bot). No target = nothing receives the chats. |
| Brand | Conversation Routing | The brand the chats belong to; shown with two or more brands. |
| Use the brand’s colour / Primary Color | Appearance | Follow the brand’s colour (default) or set a hex colour for the header, launcher, and accents. |
| Header Text | Appearance | Header bar text, up to 100 characters. Default "Chat with us". |
| Widget Logo | Appearance | Uploaded image shown in the widget header (after saving; max 5MB). |
| Widget Avatar | Appearance | Uploaded default avatar for automated messages (after saving; max 5MB). |
| Enable Dark Mode Detection | Appearance | Follow the visitor's browser dark-mode preference. Off by default. |
| Dark Primary Color / Dark Header Background / Dark Message Background | Appearance | The dark-mode color set. Defaults #90caf9, #1e1e1e, #333333. |
| Positioning Mode | Position & Placement | Corner (default), Attach to element, or Inline. |
| Corner / Offset X / Offset Y | Position & Placement | Bottom Right (default), Bottom Left, Top Right, or Top Left, and offsets in pixels. |
| Element selector / Placement / Alignment / Use this element as the launcher | Position & Placement | Attach the launcher to an element of your page, or use it as the launcher. |
| Mount selector | Position & Placement | Inline: the element the chat is drawn inside. |
| Launcher Style | Position & Placement | Bubble (default), Edge tab (edge and tab label), or Headless (custom button). |
| Scroll Behavior | Position & Placement | Fixed (default) or Scroll with page. |
| Allow user to drag the launcher / z-index / Respect device safe areas | Position & Placement | Dragging, stacking order and phone safe areas. Off / empty by default. |
| Collision avoidance / Mobile override | Position & Placement | Selectors to avoid, avoid bottom bars, and a corner for phones (default Inherit from desktop). |
| Welcome Message | Messages | Greeting when a new chat opens. Default "Hello! How can we help you today?". |
| Offline Message | Messages | Shown while a Direct to Team widget’s team is outside its hours. Default "We are currently offline. Please leave a message.". |
| Enable pre-chat form | Conversation Start | Collect contact information before the chat begins. Off by default. |
| Standard Fields (Name, Email, Phone, Company) | Conversation Start | Each field independently shown and optionally required. |
| Custom data fields | Conversation Start | Your ticket custom fields, saved on the chat’s ticket; each optionally required. |
| Show widget greeting before the flow runs | Conversation Start | Flow-routed widgets only. Off by default. |
| Auto-open Delay (seconds) | Behavior | Open automatically after a delay; empty (default) disables. |
| Show typing indicator | Behavior | Show a typing indicator while the user types. On by default. |
| Bot Typing Delay | Behavior | Typing-indicator duration before automated messages (0–5s, default 1.5s). |
| Show user avatar | Behavior | Display user profile pictures. On by default. |
| Enable file uploads | Behavior | Allow visitors to attach files. Off by default. |
| Enable emoji picker | Behavior | Show an emoji picker in the message input. On by default. |
| Allowed Domains | Allowed Domains | The domains the widget is meant for; listed in the embed code dialog. |
| A contact may resume an ended conversation for | Reply and reopen | How long a contact can continue an ended chat, or never (edit mode). |
| Default Close Message | Conversation Closure | Shown when a user closes without a custom message, up to 500 characters. |
| Profile | Identity Verification | The identity verification profile visitors’ signed tokens are checked against; None allows anonymous visitors. |
| Algorithm / Public key (PEM) | Admin > Channels > Identity Verification | Set on the profile: RSA, ECDSA, or EdDSA; you paste only the public key. |
| Claim Mappings | Identity Verification | Map token claims to contact fields, custom fields or rate limit tiers (after saving). |
Related Topics
- Conversation Flows — the visual flow builder.
- Routing Strategies & Queues — how chats and tickets reach your team.
- Routing Options — every team routing setting, including after-hours and queue alternatives.
- Setting Up AI — set up your AI chatbot.
- Unrouted Tickets — chats and tickets that have no team yet.
- Social Media Channels — Facebook Messenger, WhatsApp and Instagram: what is offered today.