Concepts
App
One place your chat runs: a website, a mobile app, or both. Each app has its own keys, its own actions, its own webhook and its own test and live modes, so a problem in one app stays there.
Publishable key
The app’s pk_… key. It is public: it goes in your page or your app, and the SDK starts a chat
with it. It works only from the web origins and mobile app ids listed on the app’s Install
screen, and only once the app is Live; in Test mode guests are capped at 20 conversations
a day.
Guest and signed-in person
Anyone chatting without a token is a guest. The SDK keeps a guest the same guest on that browser or device. A live app has a daily cap on guest conversations, which you set.
A signed-in person is named by a short token your server signs with the app’s identity
secret: HS256, with sub, an optional name, and exp at most 24 hours ahead. The SDK passes it
as userToken. The secret stays on your server.
Server key
sk_…, for the advanced case where your server starts chat sessions itself. It is a secret: keep
it on your server.
Actions
What the chat can do in your system. There are three sources:
- Your app’s own calls (the browser bridge). Import them from a HAR file saved in your browser’s DevTools, a cURL command, a Postman collection or an OpenAPI document. The file is read in your browser, and cookies and tokens are stripped before anything is saved. When the chat uses one, the SDK makes the call inside your app with the person’s existing session, so your server needs no changes and no MCP. It suits older systems with no public API.
- A server API, from its OpenAPI document. Rafiq calls it from its servers.
- An MCP server: its tools become actions.
Reads run directly. Anything that changes data shows the person what is about to happen and waits for their yes. A guest can’t run server or MCP actions that change data or read a person’s data. Whatever an action returns can’t add an action or widen what one may do.
The page’s own tools
On the web, a page can give the chat its own functions with registerTool(...), in the WebMCP
shape: a name, a description, an input schema and the function that runs. Aborting its signal takes
the tool back.
Ratings
Each answer has a thumbs up and a thumbs down; a thumbs down asks, optionally, what went wrong. Satisfaction on the Dashboard is the thumbs up out of all ratings.
Dashboard
Until your first chat, a setup checklist. After it: conversations, people, satisfaction, resolution rate, each action’s success rate and p95 time, AI cost, the conversations trend, the top actions, and the answers rated down.
Conversations
The people’s chats, for the members you give the permission to. Filter by app, rating, a failed action, guests, or date. Every call a conversation made is listed with it, and each time someone reads a conversation, the read is logged.
Customers
For platforms that resell to their own clients: each end customer, with its own budget.
Webhooks
One signed endpoint per app. It receives chat.mentioned and chat.rated, and the screen lists
recent deliveries.
Usage
Your plan’s meter, AI spend, the daily trend, and each app’s share.
The AI
Rafiq runs on AI the platform chooses and manages: you don’t pick a model or bring a key, and the assistant’s instructions and greeting are set up for you. What each conversation costs in AI counts against your plan, and the chat says so in one line, with when it resets, if a limit is reached.
Steps in the chat
While Rafiq works on an answer, the chat shows what it is doing in one small line (“Working… 3 steps”). When it is done the line folds to how long it took and how many steps; open it to see each one. A step that failed says so there.