Skip to main content
The Web Widget deployment embeds an interactive AI assistant directly into your website. Visitors can type messages, speak via microphone, and hear voice responses — all from a floating widget that loads with a single script tag. Voice input and output are optional; the widget works as a text-only chat by default.
Voice capabilities (microphone input and spoken responses) are optional. You can deploy a text-only chat widget by skipping the Voice Input and Voice Output steps during configuration.
Use Listen when enabling microphone input and Speak when enabling spoken responses for the widget.

Creating a Web Widget Deployment

Navigate to your assistant, click Configure Assistant, then select Deployments from the sidebar. Click Add Deployment and choose Web Widget. The web widget wizard walks you through four steps:
1

Experience

Define the greeting, quickstart questions, and session behaviour.Required fields:
  • Greeting — Welcome message displayed when the widget opens. Describe your agent so users know how to interact with it
Quickstart Questions:
  • Quickstart Questions — Pre-configured questions displayed as clickable buttons below the greeting. Users can tap one to start a conversation instantly, or type their own query
Advanced settings (expand to configure):
  • Error Message — Message shown when an unexpected error occurs
  • Idle Silence Timeout — Duration of silence before Rapida prompts the user (3000-10000ms, default: 30000ms)
  • Idle Timeout Backoff — How many times the idle timeout multiplies before ending the session (0-5, default: 2)
  • Idle Message — Message spoken/shown when the user hasn’t responded (default: “Are you there?”)
  • Maximum Session Duration — Hard limit before the session is automatically ended (3-15 minutes, default: 5 min)
2

Voice Input (Speech-to-Text) — Optional

Enable microphone-based voice input for the widget. Users can speak instead of typing.If enabled:
  • STT Provider — Deepgram, AssemblyAI, Google, Azure, OpenAI Whisper, AWS Transcribe, Cartesia, Rev.ai, Speechmatics, Sarvam, Groq, or Nvidia
  • Model — Provider-specific transcription model
  • Language — Primary transcription language
  • Encoding — Audio encoding format
  • Sample Rate — Audio sample rate
Advanced settings (expand to configure):
  • Voice Activity Detection (VAD) — Silero VAD with configurable threshold (0.0-1.0, default: 0.8)
  • Background Noise Removal — RNNoise for removing ambient noise before transcription
  • End of Speech Detection — Silence-based EOS with configurable timeout (default: 1000ms)
Click Skip to deploy a text-only widget without voice input. You can enable it later by editing the deployment.
3

Voice Output (Text-to-Speech) — Optional

Enable spoken audio responses from the assistant. The assistant’s text responses will be read aloud through the browser.If enabled:
  • TTS Provider — ElevenLabs, Deepgram, Azure, Google, OpenAI, AWS Polly, Cartesia, Resemble, Rime, Sarvam, Neuphonic, MiniMax, Groq, Speechmatics, or Nvidia
  • Model — Provider-specific voice model
  • Language — Output speech language
  • Voice ID — The specific voice from your TTS provider
Advanced settings (expand to configure):
  • Pronunciation Dictionaries — Custom pronunciation for domain-specific terms, names, and acronyms
  • Conjunction Boundaries — Natural pause points at conjunctions for more human-like speech
  • Pause Duration — Length of pause at conjunction boundaries (100-300ms, default: 240ms)
Click Skip to deploy without voice output. Text responses will still appear in the chat. You can enable voice output later.
4

Features

Enable additional content sections available in the web widget beyond the chat interface.Available sections:
  • Help Center / Q&A Listing — Display a searchable FAQ section alongside the chat, powered by your knowledge base
  • Product Catalog — Show product listings and details within the widget
  • Blog Post / Articles — Surface blog posts and articles for self-service browsing
Click Deploy Web Widget to save and activate the deployment.

Embedding the Widget

After deployment, Rapida generates a pre-built widget script (app.min.js) hosted on the Rapida CDN. You configure it by setting window.chatbotConfig before the script loads.

Quick Start

Add this to any page on your website:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
The default configuration renders a floating launcher in the bottom-right corner of the page. Clicking it opens the chat window with your assistant’s greeting and quickstart questions.
Replace YOUR_ASSISTANT_ID with your assistant’s ID (found on the assistant overview page) and YOUR_PROJECT_CREDENTIAL_KEY with your project credential key from the credential vault.

Installation Options

Use the latest hosted widget script:
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
Pin to a specific widget build when you need controlled rollout:
<script defer src="https://cdn-01.rapida.ai/public/scripts/v1.2.0/app.min.js"></script>
You can also install the package from npm and serve the built dist/app.min.js file from your own application or CDN:
npm install @rapidaai/web-widget

Configuration Options

Set window.chatbotConfig before loading the widget script. The widget has two configuration layers:
  • Rapida layer — connection, authentication, assistant version, user identity, language, and debug logging
  • UI layer — native IBM AI Chat configuration exposed directly on window.chatbotConfig
Rapida always owns messaging.customSendMessage because text messages must go through the Rapida SDK. Rapida also appends its audio controls through renderWriteableElements.afterInputElement; if you provide your own afterInputElement, it is preserved and Rapida audio controls are appended after it. Use the sectioned config shape below. Do not use a carbon config key.
<script>
  window.chatbotConfig = {
    // Required
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",

    // Optional: target a specific assistant version
    assistant_version: "VERSION_ID",

    // Optional: custom API base URL (for self-hosted deployments)
    api_base: "https://assistant-01.in.rapida.ai",

    // Optional: language for the widget UI (default: "en", auto-detects from <html lang="">)
    language: "en",

    // Optional: enable debug logging in the browser console
    debug: false,

    // Optional: user identification
    user: {
      name: "Jane Doe",
      user_id: "user-123",
      meta: {
        plan: "enterprise",
        source: "pricing-page",
      },
    },

    // Optional: assistant identity
    name: "Support Bot",
    logo_url: "https://example.com/avatar.png",

    // Optional: layout
    layout: {
      mode: "floating",          // "floating" | "docked-right" | "docked-left" | "inline"
      position: "bottom-right",  // "bottom-right" | "bottom-left" | "top-right" | "top-left"
      corners: "square",
      showFrame: true,
      customProperties: {
        width: "420px",
        height: "640px",
      },
    },

    // Optional: theme
    theme: {
      mode: "light",             // "light" | "dark" | "system"
      injectTheme: "g10",        // "white" | "g10" | "g90" | "g100"
    },

    // Optional: chat UI sections
    aiEnabled: false,
    header: {
      title: "Support Bot",
      showAiLabel: false,
      minimizeButtonIconType: "side-panel-right",
    },
    launcher: {
      isOn: true,
    },
    history: {
      isOn: false,
    },
    messaging: {
      messageTimeoutSecs: 150,
      messageLoadingIndicatorTimeoutSecs: 1,
    },
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>

Required Rapida Options

PropertyTypeDefaultDescription
assistant_idstringrequiredRapida assistant ID.
tokenstringrequiredProject credential key from the credential vault.

Rapida Options

PropertyTypeDefaultDescription
api_basestringhttps://assistant-01.in.rapida.aiRapida API base URL. Use this for self-hosted or environment-specific backends.
assistant_versionstringlatest versionAssistant version to load when the backend supports versioned deployments.
user.namestringGuestDisplay name for the current user.
user.user_idstringgenerated and stored locallyStable user ID. Provide one if your host app already has an authenticated user ID.
user.metaRecord<string, string>{ source: "web plugin" }Extra metadata sent to Rapida with the user session.
languagestringhost page language or enLocale passed to the UI. The widget also watches the <html lang> attribute.
debugbooleanfalseEnables additional client logging and passes debug mode to the UI layer.
namestringdeployment nameFriendly assistant name. Used as the default assistantName and header.title.
logo_urlstringdefault assistant avatarAssistant avatar URL. Used as the default assistantAvatarUrl.

Theme Options

Use theme for all theme-level options.
PropertyTypeDefaultDescription
theme.mode"light" | "dark" | "system""light"Widget color mode. dark defaults the UI token injection to g100; light defaults it to g10; system lets the host or system decide unless theme.injectTheme is set.
theme.injectTheme"white" | "g10" | "g90" | "g100"derived from theme.modeUI theme token injected into the chat shadow DOM. Set this when the host page does not already provide compatible theme tokens.
theme.colorstringnoneLegacy primary brand color. Prefer layout.customProperties for current UI customization.

Layout Options

layout can be a string for old embeds or an object for the current sectioned config.
window.chatbotConfig = {
  layout: {
    mode: "floating",
    position: "bottom-right",
    corners: "square",
    showFrame: true,
    customProperties: {
      width: "420px",
      height: "640px",
    },
  },
};
PropertyTypeDefaultDescription
layoutstring | object"floating"Widget layout. String values are still supported: "floating", "docked-right", "docked-left", "inline".
layout.mode"floating" | "docked-right" | "docked-left" | "inline""floating"Rapida placement mode.
layout.position"bottom-right" | "bottom-left" | "top-right" | "top-left""bottom-right"Floating launcher and panel position.
layout.showLauncherbooleantrue for floatingLegacy launcher shortcut inside layout. Prefer launcher.isOn.
layout.showFramebooleantrueKeeps the native border and shadow frame.
layout.hasContentMaxWidthbooleanUI defaultConstrains message content to the UI max width.
layout.corners"round" | "square" | object"square"Corner style. Use a string for all corners or an object for per-corner control.
layout.customPropertiesRecord<string, string>generated for floatingCSS variable overrides for the chat UI. Values are raw CSS strings.
Per-corner layout.corners object:
PropertyTypeDescription
startStart"round" | "square"Top-left in LTR, top-right in RTL.
startEnd"round" | "square"Top-right in LTR, top-left in RTL.
endStart"round" | "square"Bottom-left in LTR, bottom-right in RTL.
endEnd"round" | "square"Bottom-right in LTR, bottom-left in RTL.
Supported layout.customProperties keys:
KeyDescription
heightFloating chat height.
max-heightFloating chat maximum height.
widthFloating chat width.
min-heightFloating chat minimum height.
max-widthFloating chat maximum width.
z-indexFloating chat z-index.
bottom-positionFloating panel distance from viewport bottom.
right-positionFloating panel distance from viewport right.
top-positionFloating panel distance from viewport top.
left-positionFloating panel distance from viewport left.
launcher-default-sizeLauncher button size.
launcher-position-bottomLauncher distance from viewport bottom.
launcher-position-rightLauncher distance from viewport right.
launcher-extended-widthExpanded launcher width.
messages-max-widthMaximum width for message content.
messages-min-widthMinimum width for message content.
workspace-min-widthMinimum width for workspace panels.
card-max-widthMaximum width for card responses.
launcher-color-backgroundLauncher background color.
launcher-color-avatarLauncher icon/avatar color.
launcher-color-background-hoverLauncher hover background.
launcher-color-background-activeLauncher active background.
launcher-color-focus-borderLauncher focus border color.
launcher-mobile-color-textMobile launcher text color.
launcher-expanded-message-color-textExpanded launcher text color.
launcher-expanded-message-color-backgroundExpanded launcher background.
launcher-expanded-message-color-background-hoverExpanded launcher hover background.
launcher-expanded-message-color-background-activeExpanded launcher active background.
launcher-expanded-message-color-focus-borderExpanded launcher focus border color.
unread-indicator-color-backgroundUnread indicator background color.
unread-indicator-color-textUnread indicator text color.

Header Options

PropertyTypeDefaultDescription
header.isOnbooleantrueEnables the native chat header. Set false for a fully embedded or fullscreen experience with your own app header.
header.titlestringname or deployment nameHeader title. Set "" to remove the visible title.
header.namestringUI defaultSecondary name shown after the title. Set "" to remove it.
header.minimizeButtonIconType"close" | "minimize" | "side-panel-left" | "side-panel-right" | "side-panel-down"side-panel icon based on dock sideIcon for the close/minimize button.
header.hideMinimizeButtonbooleanfalseHides the close/minimize button.
header.showRestartButtonbooleanfalseShows the restart conversation button.
header.menuOptionsArray<{ text: string }>noneCustom menu options in the header menu.
header.showAiLabelbooleanfalseShows the AI label in the header. Disabled by default.
header.hideDefaultAiLabelContentbooleantrueHides the default AI label popover content.
header.hasContentMaxWidthbooleanfalseConstrains the header to the message content width.
header.actionsToolbarAction[]noneCustom header toolbar actions.

Launcher Options

PropertyTypeDefaultDescription
launcher.isOnbooleantrue for floating, false for docked/inlineShows the floating launcher button.
launcher.showUnreadIndicatorbooleanUI defaultShows the unread dot on the launcher.
launcher.mobile.avatarUrlOverridestringnoneCustom mobile launcher avatar or icon URL.
launcher.mobile.isOnbooleanfalseDeprecated expanded call-to-action launcher state.
launcher.mobile.titlestringtranslated defaultDeprecated expanded launcher title.
launcher.mobile.timeToExpandnumber15Deprecated delay before launcher expansion, in seconds.
launcher.desktop.avatarUrlOverridestringnoneCustom desktop launcher avatar or icon URL.
launcher.desktop.isOnbooleanfalseDeprecated expanded call-to-action launcher state.
launcher.desktop.titlestringtranslated defaultDeprecated expanded launcher title.
launcher.desktop.timeToExpandnumber15Deprecated delay before launcher expansion, in seconds.

Messaging Options

PropertyTypeDefaultDescription
messaging.skipWelcomebooleanUI defaultStarts new conversations without requesting a welcome message.
messaging.messageTimeoutSecsnumber150Message timeout in seconds. Use 0 to disable automatic timeout.
messaging.messageLoadingIndicatorTimeoutSecsnumber1Delay before the UI shows a loading indicator. Use 0 to prevent the UI from showing one automatically.
messaging.customSendMessagefunctionRapida bridgeReserved. Rapida overwrites this so text is sent through the Rapida SDK.
messaging.customLoadHistoryfunctionnoneOptional function that returns native history items for the UI.
messaging.showStopButtonImmediatelybooleanfalseShows the stop button as soon as a message request starts.

Other UI Options

PropertyTypeDefaultDescription
history.isOnbooleanfalseEnables the native history panel.
history.showMobileMenubooleantrueShows mobile header menu options for new chat and view chats.
history.startClosedbooleanfalseStarts history closed and preserves open/closed state across responsive mode changes.
input.maxInputCharactersnumber10000Maximum characters allowed in the text input.
input.isVisiblebooleantrueShows or hides the main input surface.
input.isDisabledbooleanfalseDisables text input. Rapida also disables text input while audio mode is active.
homescreen.isOnbooleanfalseEnables the native home screen before chat.
homescreen.greetingstringnoneGreeting text on the home screen.
homescreen.starters.isOnbooleanUI defaultShows starter buttons.
homescreen.starters.buttonsArray<{ label: string; isSelected?: boolean }>noneStarter utterances displayed as buttons.
homescreen.customContentOnlybooleanfalseHides the built-in greeting and starters so custom content can own the home screen.
homescreen.disableReturnbooleanfalsePrevents returning to the home screen after a user has sent a message.
disclaimer.isOnbooleanfalseShows a disclaimer screen before chat.
disclaimer.disclaimerHTMLstringrequired when enabledHTML content for the disclaimer. If this changes after acceptance, the user must accept again.
aiEnabledbooleanfalseEnables AI visual styling. The widget disables this by default.
assistantNamestringname or deployment nameAssistant name used by the UI for accessibility, errors, and defaults.
assistantAvatarUrlstringlogo_urlAssistant avatar URL used by native messages.
localestringlanguageUI locale. Prefer language unless you need to override only the UI.
namespacestringrapida-chatNamespace for DOM IDs, storage keys, and multi-instance isolation. Must be 30 characters or fewer.
openChatByDefaultbooleantrue for docked/inline, false for floatingOpens the chat when it first renders.
shouldSanitizeHTMLbooleantrueSanitizes assistant HTML before rendering.
shouldTakeFocusIfOpensAutomaticallybooleanfalseMoves focus into the chat when it opens on page load.
disableCustomElementMobileEnhancementsbooleanfalseDisables mobile enhancements that can conflict with custom element embedding.
isReadonlybooleanfalsePuts the chat in read-only mode for viewing old conversations.
persistFeedbackbooleanfalseKeeps feedback controls visible beyond the latest message.
stringspartial language packUI defaultsOverrides built-in UI strings.
injectCarbonTheme"white" | "g10" | "g90" | "g100"derived from themeRaw UI prop. Prefer theme.injectTheme.
onErrorfunctionnoneCalled for catastrophic UI errors.

Upload Options

File upload is experimental in the underlying UI.
PropertyTypeDefaultDescription
upload.is_onbooleanfalseEnables the attachment button. Requires upload.onFileUpload.
upload.acceptstringall file typesAccepted MIME types or extensions, same format as the HTML accept attribute.
upload.maxFileSizeBytesnumbernoneClient-side maximum file size.
upload.maxFilesnumbernoneMaximum number of pending files.
upload.onFileUploadfunctionnoneCalled once per selected file. Return structured data for the pending message.

Keyboard Shortcut Options

Keyboard shortcut configuration is experimental in the underlying UI.
PropertyTypeDefaultDescription
keyboardShortcuts.messageFocusToggle.is_onbooleantrueEnables the message/input focus toggle shortcut.
keyboardShortcuts.messageFocusToggle.keystring"F6"Primary shortcut key.
keyboardShortcuts.messageFocusToggle.modifiers.altbooleanfalseRequires Alt.
keyboardShortcuts.messageFocusToggle.modifiers.shiftbooleanfalseRequires Shift.
keyboardShortcuts.messageFocusToggle.modifiers.ctrlbooleanfalseRequires Control.
keyboardShortcuts.messageFocusToggle.modifiers.metabooleanfalseRequires Command/Meta.

Service Desk Options

These are advanced native UI options for human-agent handoff integrations.
PropertyTypeDefaultDescription
serviceDeskFactoryfunctionnoneFactory that creates a service desk integration instance.
serviceDesk.availabilityTimeoutSecondsnumberUI defaultTimeout used while checking whether human agents are available.
serviceDesk.skipConnectHumanAgentCardbooleanfalseAuto-connects to an available agent after a connect-to-agent response while still showing the card.
serviceDesk.agentJoinTimeoutSecondsnumbernoneTimeout while waiting for an agent to join after one is requested.
serviceDesk.allowReconnectbooleantrueAttempts to reconnect the user to a prior human-agent conversation when supported.

Render And Lifecycle Hooks

PropertyTypeDescription
onBeforeRender(instance)functionCalled before the UI renders. Rapida uses this internally, then calls your handler.
onAfterRender(instance)functionCalled after the UI renders.
onViewPreChange(event, instance)functionCalled before the chat opens or closes. Can return a promise to delay the view change.
onViewChange(event, instance)functionCalled after the chat opens or closes. Rapida uses this to track docked/inline shell state, then calls your handler.
renderUserDefinedResponsefunctionRenders custom user_defined response items.
renderCustomMessageFooterfunctionRenders custom message footers.
renderWriteableElementsobjectRenders writable slots. Rapida merges afterInputElement with its audio controls.

Layout Modes

Floating

A fixed-position panel with a launcher button. Click the launcher to open or close the chat.
window.chatbotConfig = {
  layout: {
    mode: "floating",
    position: "bottom-right",
  },
  launcher: {
    isOn: true,
  },
};

Docked

A side panel fixed to the viewport. When open, it pushes page content to make room.
window.chatbotConfig = {
  layout: {
    mode: "docked-right", // or "docked-left"
  },
};

Inline

The widget flows with the page content. Place the <div id="rapida-chat-app"> where you want it to render.
<div id="rapida-chat-app"></div>
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
    layout: {
      mode: "inline",
    },
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>

Legacy Shortcuts

These remain supported for old embeds. Prefer the sectioned config above for new usage.
PropertyReplacement
layout: "floating"layout: { mode: "floating" }
layout: "docked-right"layout: { mode: "docked-right" }
layout: "docked-left"layout: { mode: "docked-left" }
layout: "inline"layout: { mode: "inline" }
positionlayout.position
showLauncherlauncher.isOn

Full HTML Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Website</title>
</head>
<body>
  <h1>Welcome to my website</h1>

  <!-- Rapida Web Widget Configuration -->
  <script>
    window.chatbotConfig = {
      assistant_id: "YOUR_ASSISTANT_ID",
      token: "YOUR_PROJECT_CREDENTIAL_KEY",
      user: {
        name: "Jane Doe",
        user_id: "website-visitor-001",
        meta: {
          source: "marketing-site",
          page: window.location.pathname,
        },
      },
      name: "Support Bot",
      logo_url: "https://example.com/avatar.png",
      layout: {
        mode: "floating",
        position: "bottom-right",
        customProperties: {
          width: "420px",
          height: "640px",
        },
      },
      theme: {
        mode: "light",
        injectTheme: "g10",
      },
      header: {
        title: "Support Bot",
        showAiLabel: false,
      },
      launcher: {
        isOn: true,
      },
    };
  </script>
  <script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
</body>
</html>
Place both script tags just before the closing </body> tag. The defer attribute on app.min.js ensures it loads after the config is set without blocking page rendering.

Full-Screen Widget

To make the widget fill the entire viewport, use inline mode and mount the widget into a full-page #rapida-chat-app element:
<style>
  html,
  body,
  #rapida-chat-app {
    width: 100%;
    height: 100%;
    margin: 0;
  }
</style>
<div id="rapida-chat-app"></div>
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
    layout: {
      mode: "inline",
      showFrame: false,
    },
    header: {
      isOn: false,
    },
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>

Platform Integration Guides

  1. Go to Appearance > Theme File Editor (or use a plugin like Insert Headers and Footers)
  2. Add the following before the closing </body> tag in your theme’s footer.php:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
  1. Save and verify the widget loads on your site
  1. Go to Online Store > Themes > Edit Code
  2. Open theme.liquid
  3. Add the scripts before the closing </body> tag:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
  1. Save and preview your store
  1. Go to Project Settings > Custom Code
  2. Paste in the Footer Code section:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
  1. Publish your site
  1. Go to Settings > Advanced > Code Injection
  2. Paste in the Footer section:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
  1. Save and preview your site
Use Next.js Script component in your root layout:
// app/layout.tsx (App Router)
import Script from "next/script";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script id="rapida-config" strategy="beforeInteractive">
          {`window.chatbotConfig = {
            assistant_id: "${process.env.NEXT_PUBLIC_RAPIDA_ASSISTANT_ID}",
            token: "${process.env.NEXT_PUBLIC_RAPIDA_TOKEN}",
          };`}
        </Script>
        <Script
          src="https://cdn-01.rapida.ai/public/scripts/app.min.js"
          strategy="lazyOnload"
        />
      </body>
    </html>
  );
}
// nuxt.config.ts
export default defineNuxtConfig({
  app: {
    head: {
      script: [
        {
          children: `window.chatbotConfig = {
            assistant_id: "YOUR_ASSISTANT_ID",
            token: "YOUR_PROJECT_CREDENTIAL_KEY",
          };`,
        },
        {
          src: "https://cdn-01.rapida.ai/public/scripts/app.min.js",
          defer: true,
        },
      ],
    },
  },
});
For plain Vue, add the script tags directly to public/index.html.
Add to src/index.html before the closing </body> tag:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
Copy and paste the following into any HTML page:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>

Self-Hosted Deployment

If you’re running Rapida on your own infrastructure, override the api_base to point at your assistant API:
<script>
  window.chatbotConfig = {
    assistant_id: "YOUR_ASSISTANT_ID",
    token: "YOUR_PROJECT_CREDENTIAL_KEY",
    api_base: "https://your-assistant-api.example.com",
  };
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>
You can also self-host the widget script itself. Build the react-widget SDK and upload the generated dist/app.min.js to your own CDN or static file server:
cd sdks/react-widget
npm install
npm run build
# Upload dist/app.min.js to your CDN
Then reference your self-hosted script:
<script defer src="https://your-cdn.example.com/scripts/app.min.js"></script>

How It Works

When the widget script loads, it:
  1. Reads configuration from window.chatbotConfig
  2. Reuses an existing <div id="rapida-chat-app"> or creates one and appends it to the page <body>
  3. Initialises a VoiceAgent instance using the @rapidaai/react SDK with the web plugin client connection
  4. Fetches the assistant’s web plugin deployment config (greeting, suggestions, voice settings)
  5. Renders the configured layout: floating launcher, docked side panel, or inline chat
  6. Supports both text input and voice input (with microphone visualizer, device selection, and mute controls)
  7. Passes supported UI configuration through to the native IBM AI Chat layer
  8. Auto-detects language changes on the <html lang=""> attribute
  9. Persists the user ID in localStorage (rpd__uuid) across sessions when no user.user_id is provided

Widget Features

The pre-built widget includes:
  • Text chat — Type messages and receive markdown-rendered responses
  • Voice input — Click the audio icon to switch to voice mode with real-time microphone visualization
  • Microphone device selector — Choose from available input devices via a dropdown flyout
  • Mute/unmute — Toggle microphone during voice conversations
  • Quickstart suggestions — Clickable buttons from your deployment’s configured suggestions
  • Session reset — Restart the conversation via the header button
  • Auto-scroll — Chat automatically scrolls to the latest message
  • Layout modes — Use floating, docked-right, docked-left, or inline rendering
  • Theme controls — Use light, dark, system, or explicit UI token injection

Input and Output Modes

Voice InputVoice OutputUser Experience
DisabledDisabledText-only chat
EnabledDisabledUsers speak, assistant replies with text
DisabledEnabledUsers type, assistant replies with voice + text
EnabledEnabledFull voice conversation with text transcript

Troubleshooting

IssueSolution
Widget does not appearVerify assistant_id and token are correct. Check the browser console for errors — the widget logs "Please provide an assistant_id" or "Please provide an authentication token" if either is missing
Voice input not workingEnsure the page is served over HTTPS (required for microphone access). Check that the deployment has STT configured
Widget loads but shows no greetingEnsure you have an active Web Widget deployment for this assistant (not an SDK/API deployment)
User ID resets across visitsThe widget stores the auto-generated ID in localStorage as rpd__uuid. If localStorage is cleared, a new ID is generated. Pass a stable user.user_id in the config to avoid this
CORS errors in consoleIf self-hosting, ensure your reverse proxy allows requests from your website’s origin to the assistant API
window.chatbotConfig not readMake sure the config script runs before app.min.js. Use a regular <script> tag (not defer) for the config, and defer on the widget script

Use Cases

Customer Support

Provide instant answers and reduce support ticket volume with 24/7 voice-enabled help.

Lead Generation

Engage visitors with qualifying questions and route them to your sales team.

Product Recommendations

Guide users through product catalogs with personalized suggestions.

Appointment Scheduling

Let users book appointments directly through conversational flow.
  • Create an Assistant — Set up your assistant before deploying
  • Listen — Choose and tune STT, VAD, noise cancellation, and EOS settings
  • Speak — Choose and tune TTS, voice, pronunciation, and speech delivery settings
  • Web App (React SDK) — Full SDK integration for custom React apps with complete UI control
  • Credentials — Manage your project credential keys
  • Conversation Logs — Monitor widget conversations
  • Webhooks — Receive post-conversation events