Getting started
Rafiq puts a chat in your app that can act in your own system. It reads directly, asks the person before anything changes, and shows you how every conversation went. Setting it up takes three steps: add the app → paste the snippet with its key → (optional) sign your users in.
1. Get an account
Sign up from the pricing page: pick a plan, create your account and your organisation in one step, and confirm the plan. You land in the portal, signed in, on the Dashboard, which shows a setup checklist until your first chat.
2. Add your app
Open Apps and choose Add an app. It asks for a name only.
3. Paste the snippet
Open the app’s Install screen:
-
The key. The app’s publishable key (
pk_…) is shown in full, with a copy button. It is public: it is safe in a web page or a mobile app. -
The snippet. Pick your platform: a script tag or npm for the web, Flutter, Android or iOS. The key and the address are already filled in. On the web:
<script src="…/rafiq.iife.js"></script> <script>RafiqWeb.init({ baseUrl: "…", appKey: "pk_…" })</script>Copy the snippet from the Install screen rather than this page: it has your real address. The SDK guides for the web, Flutter, Android and iOS cover the rest.
-
Where the key works. List the web origins (
https://shop.example.com) and the mobile app ids (the package or bundle id) the key may be used from, then switch the app from Test to Live. Going live needs at least one origin or app id. In test mode a guest has at most 20 conversations a day; a live app has its own daily cap for guests, which you set here.
The screen shows Waiting for the first chat… and turns green when the SDK first connects.
4. Sign your users in (optional)
Without it, everyone is a guest. A guest can talk and use your app’s own calls, but can’t run server or MCP actions that change data or read a person’s data.
To name the person, create the app’s identity secret on the Install screen. Your server signs a
short token with it (HS256) holding sub (your user’s id), optionally name, and exp at most
24 hours ahead, and the SDK passes it as userToken:
// On your server, for the signed-in user.
const token = jwt.sign({ sub: user.id, name: user.name }, IDENTITY_SECRET, {
algorithm: "HS256",
expiresIn: "1h",
});
The identity secret never goes into the page or the app. Advanced: server keys (sk_…) let
your server start sessions itself.
5. Give it something to do
Open Actions and add what the chat may do in your system. See Concepts for the three sources: your app’s own calls, a server API, or an MCP server.
Next
- Concepts: apps, keys, guests, actions and confirmations.
- Read real conversations in Conversations, and how it’s going on the Dashboard.