Documentation
Integration guides, API reference, and troubleshooting.
For most integrations, the widget is enough: it handles end-user tokens, UI, and persona automatically.
<RiserWidget
projectKey="YOUR_PUBLISHABLE_KEY"
apiBase="https://riserlabs.io"
title="AI chat"
position="right"
/>Use the Publishable Key from your project dashboard.
This snippet loads /widget.js and configures window.RiserChatWidget.
"use client";
import { useEffect } from "react";
type Props = {
projectKey: string;
apiBase: string;
title?: string;
position?: "left" | "right";
};
export function RiserWidget({
projectKey,
apiBase,
title = "AI chat",
position = "right",
}: Props) {
useEffect(() => {
const base = apiBase.replace(/\/+$/, "");
// 1) Config BEFORE loading widget.js
(window as any).RiserChatWidget = {
projectKey,
apiBase: base,
title,
position,
// optional:
// locale: "en",
// theme: "auto",
// externalUserId: "user_123",
};
// 2) Load widget.js once
const id = "riser-widget-loader";
if (document.getElementById(id)) return;
const s = document.createElement("script");
s.id = id;
s.async = true;
s.src = `${base}/widget.js`;
document.body.appendChild(s);
}, [projectKey, apiBase, title, position]);
return null;
}Before going live, make sure these are set:
- Widget settings: Settings → Widget
- Allowed domains: Settings → Domains
- Sources / Knowledge: Settings → Sources
Recommended security settings for production:
- Restrict Allowed Domains (domain-gate).
- Avoid executing actions directly from model output (CTA should be server-controlled).
- Use captcha limits when exposed publicly.
If you already implemented hostToken flow, mention it here as your default hardening.
You can configure accent color, launcher style, business hours, and legal links.
- Embed & key — Settings → Widget → Embed
- Appearance & hours — Settings → Widget → Appearance
- Legal / consent — Settings → Widget → Legal
All UI supports light/dark themes via Tailwind 'dark:' classes.
Sources are used to build context for the assistant (policies, product data, docs).
- URL sources are periodically synced and extracted.
- Files (PDF/XLSX/CSV) can be uploaded for knowledge ingestion.
- YML feeds can be treated as catalog sources if you prefix title with [CATALOG].
Manage sources here: Settings → Sources
Persona defines system rules: tone, conversion behavior, refusal policy, and how strictly context must be followed.
Configure persona here: Settings → Persona
CTA actions are configured in the dashboard and executed server-side. This prevents prompt injection from generating dangerous actions.
Manage CTAs here: Settings → CTA actions
Leads capture user contacts + chat summary + UTMs, and can be delivered to external systems.
- Leads table: Settings → Leads
- Delivery: Enable delivery to Email / Telegram / Webhook in Leads Settings.
- CRM: Use Webhook integration to push leads into your CRM.