In-App Chat SDK
Beta
SDK + REST

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.

Message Latency

<80ms

p95 in-region

Token TTL

1h–24h

configurable per mint

Payload Size

10 KB

text body max

Status

Beta

API may evolve

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.

Your Backend

Authenticates your app users, then mints Sendexa chat tokens:

POST /v1/chat-sdk/users/token

Creates channels and can post messages server-side.

Client SDK

@sendexa/chat-sdk for web and React Native:

  • initconnect
  • sendMessage / on('message')
  • presence, typing, read receipts
Webhooks

Push chat activity to your server for moderation, analytics, and push notify:

  • chat.message.created
  • chat.member.joined
  • chat.channel.created
Quick Start

Mint a user token on your server, then connect the client and send a message.

Bash
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
}'
Response
{
"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

Authentication Model
CallerCredentialUsed for
Your serverAuthorization: Basic <dashboard token>Mint user tokens, create channels, post/list messages via REST
End-user clientuser chat token (JWT)WebSocket connect, send messages, presence, typing, read
Core Concepts

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

MethodPathDescription
POST
/v1/chat-sdk/users/tokenMint a short-lived user chat token
POST
/v1/chat-sdk/channelsCreate a channel and add members
GET
/v1/chat-sdk/channels/:id/messagesList message history for a channel
POST
/v1/chat-sdk/channels/:id/messagesPost a message as a user or system