Skip to content

How it works

Widget-Chat has four moving parts. You touch two of them (the dashboard and the SDK); the other two are managed for you.

1. The dashboard

Where you create a project and configure everything: name, persona (system instructions), tools, appearance, languages, disclosure, and feature toggles. Each project has a public secret key and a set of server-only keys.

2. The config API — /api/project/config/

When the SDK starts it calls this endpoint with your project’s secret key (as the X-Project-Secret-Key header) and gets back the project’s public config — everything on the Dashboard side of the Configuration reference. Change a setting in the dashboard and every client picks it up on next load. No app redeploy.

3. The SDK

The drop-in widget for Web, React or Flutter. It renders the chat, merges the server config with the host-provided identity/session values, and talks to the chat backend.

4. The chat backend — /api/chat/

Runs the model, executes the bot’s tools, streams back plain text or rich content (cards, carousels, buttons, …), and stores history keyed by your userID.

The request flow

Your app ──mount SDK(secretKey, userID)──▶ SDK
SDK ──GET /api/project/config/────────▶ config (name, colours, toggles…)
SDK ──GET /api/chat/history/{userId}/─▶ prior messages
user ──types──▶ SDK ──POST /api/chat/──▶ backend ──▶ model + tools
SDK ◀──text | rich_content──────────── backend

What you provide vs what the server provides

  • You (host): projectSecretKey, userID, and optionally a userIdSignature, authToken, and userContext. Plus a few local UX overrides.
  • The server (dashboard): everything else — name, greeting, persona, colours, languages, disclosure, feature toggles.

See the Configuration reference for the exact split and merge precedence.