In-App Chat SDK
Closed-loop real-time messaging inside your mobile or web app. Your server authenticates users; the client SDK handles connect, send, presence, typing, and read receipts — with REST for server-side channel and message control.
Real-time WebSocket
Low-latency messaging over a managed WebSocket connection with automatic reconnect and offline queueing.
Server-minted Tokens
Never expose your API key to clients. Your backend mints short-lived user tokens for every chat session.
Channels & Members
1:1 DM, group, and broadcast channels with membership control from your server or client.
Presence
Online / offline / away state for every user, synced in real time across all connected clients.
Typing Indicators
Ephemeral typing events that expire automatically — no cleanup code required on your side.
Read Receipts
Per-message and per-channel read watermarks so UIs can show delivered and seen states accurately.
Server Webhooks
chat.message.created, chat.member.joined, and chat.channel.created push events to your backend.
JS & React Native
One @sendexa/chat-sdk package for web and React Native with the same event-driven API.
<80ms
p95 in-region
1h–24h
configurable per mint
10 KB
text body max
Beta
API may evolve
Authentication
Authorization: Basic <token>. Auth guide →Architecture
Chat SDK uses a split model: your backend owns secrets and user identity; end-user devices only hold short-lived user tokens. Clients talk over WebSocket for live events and can fall back to REST for history. Your server can also create channels and post system messages with Basic Auth.
Authenticates your app users, then mints Sendexa chat tokens:
POST /v1/chat-sdk/users/tokenCreates channels and can post messages server-side.
@sendexa/chat-sdk for web and React Native:
init→connectsendMessage/on('message')- presence, typing, read receipts
Push chat activity to your server for moderation, analytics, and push notify:
- chat.message.created
- chat.member.joined
- chat.channel.created
Mint a user token on your server, then connect the client and send a message.
curl -X POST 'https://api.sendexa.co/v1/chat-sdk/users/token' \-H 'Content-Type: application/json' \-H 'Authorization: Basic YOUR_DASHBOARD_BASE64_TOKEN' \-d '{"userId": "user_01HZX9K2M","displayName": "Ama Mensah","ttl": 3600}'
{"success": true,"code": "CHAT_USER_TOKEN_ISSUED","message": "User chat token minted.","requestId": "REQ-1782001100001","timestamp": "2026-07-12T10:00:00.000Z","data": {"userId": "user_01HZX9K2M","displayName": "Ama Mensah","token": "chat_usr_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...","expiresAt": "2026-07-12T11:00:00.000Z","ttl": 3600}}
Documentation
Install the SDK, mint a user token, connect a client, and send your first message.
POST /v1/chat-sdk/users/token — mint, refresh, and revoke user session tokens securely.
Create channels, send and list messages, mark read, and stream presence / typing events.
Receive chat.message.created, chat.member.joined, and chat.channel.created on your server.
| Caller | Credential | Used for |
|---|---|---|
| Your server | Authorization: Basic <dashboard token> | Mint user tokens, create channels, post/list messages via REST |
| End-user client | user chat token (JWT) | WebSocket connect, send messages, presence, typing, read |
User
An identity in your app, identified by a stable userId you control. Display name is optional metadata shown in chat UIs.
Channel
A conversation container (dm, group, or broadcast) with a member list and ordered message history.
Message
Immutable text (and optional metadata) posted to a channel by a user or your server. Delivered over WebSocket and persisted for history.
Presence / Typing / Read
Ephemeral or lightweight state events that keep UIs feeling live without writing full messages to history.
Server REST Surface
| Method | Path | Description |
|---|---|---|
POST | /v1/chat-sdk/users/token | Mint a short-lived user chat token |
POST | /v1/chat-sdk/channels | Create a channel and add members |
GET | /v1/chat-sdk/channels/:id/messages | List message history for a channel |
POST | /v1/chat-sdk/channels/:id/messages | Post a message as a user or system |
Best Practices
- Mint tokens only on your trusted backend after you have authenticated the user in your own system
- Keep
ttlshort (e.g. 1 hour) and refresh from your API when the client approaches expiry - Use webhooks for offline push and moderation — do not rely solely on connected clients
- Treat
userIdas an immutable external id; never reuse ids across real people - Prefer server-created channels for support / marketplace flows so membership stays authoritative