Two ways to integrate the Rapida chat widget into your project:
| Method | Folder | Best for |
|---|---|---|
| HTML / JS embed | html/ |
Any website — just add a <script> tag |
| React dependency | react/ |
React apps — full component-level control |
Drop-in integration. No build step needed.
<script>
window.chatbotConfig = {
assistant_id: "YOUR_ASSISTANT_ID",
token: "YOUR_API_KEY",
};
</script>
<script defer src="https://cdn-01.rapida.ai/public/scripts/app.min.js"></script>| File | Description |
|---|---|
floating.html |
Floating panel with launcher FAB (default) |
docked-right.html |
Panel docked to right side, pushes page content |
docked-left.html |
Panel docked to left side, pushes page content |
custom-theme.html |
Custom colors, dark mode, CSS variable overrides |
local-dev.html |
Loads from local build for development |
# 1. Build the widget
cd sdks/react-widget
npm install && npm run build
# 2. Serve examples (file:// protocol won't work)
cd examples/react-widget/html
python3 -m http.server 8000
# 3. Open
open http://localhost:8000/local-dev.htmlInstall as an npm package for full React integration with props, hooks, and component-level customization.
cd examples/react-widget/react
npm install
npm start
# Opens http://localhost:3000See react/src/App.tsx for usage examples covering all layout modes.
window.chatbotConfig = {
// Required
assistant_id: "...",
token: "...",
// Display
name: "My Assistant", // header name (falls back to deployment name)
logo_url: "https://example.com/logo.png", // header logo (falls back to text initial)
// Layout
layout: "floating", // "floating" | "docked-right" | "docked-left" | "inline"
position: "bottom-right", // "bottom-right" | "bottom-left" | "top-right" | "top-left"
showLauncher: true, // hide to use your own trigger (floating only)
// Theme
theme: {
mode: "light", // "light" | "dark"
},
// User identity
user: {
name: "Jane Doe",
user_id: "user-123",
meta: { plan: "pro" },
},
// Advanced
api_base: "https://...", // custom API endpoint
language: "en", // BCP 47 language tag
debug: false, // verbose console logging
};:root {
--rpd-primary: #198038; /* brand color */
--rpd-panel-width: 450px; /* panel width */
--rpd-border-radius: 8px; /* global border radius */
--rpd-font-sans: 'Inter', sans-serif;
}See sdks/react-widget/src/styles/index.css for the full list of --rpd-* tokens.
- Sign in to the Rapida Console
- Create or open a project -> copy your API Key
- Open Assistants -> copy your Assistant ID