Documentation

Integration guides, API reference, and troubleshooting.

Widget integration (Quick start)
Most popular

For most integrations, the widget is enough: it handles end-user tokens, UI, and persona automatically.

1
Choose an integration method
<RiserWidget
  projectKey="YOUR_PUBLISHABLE_KEY"
  apiBase="https://riserlabs.io"
  title="AI chat"
  position="right"
/>

Use the Publishable Key from your project dashboard.

2
Load widget.js once

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;
}
3
Configure your project in the dashboard

Before going live, make sure these are set:

Security checklist

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.

Customization (appearance & hours)

You can configure accent color, launcher style, business hours, and legal links.

All UI supports light/dark themes via Tailwind 'dark:' classes.

Sources & catalog scanning

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

Personas & model behavior

Persona defines system rules: tone, conversion behavior, refusal policy, and how strictly context must be followed.

Configure persona here: Settings → Persona

CTA buttons (controlled actions)

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 & integrations (Email / Telegram / Webhook / CRM)

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.