Skip to main content

ChatSDK Documentation

A modern, real-time chat SDK for building messaging features into your applications.

Quick Start

Installation

# Core SDK
npm install @chatsdk/core

# React Components
npm install @chatsdk/react

# React Native
npm install @chatsdk/react-native

Basic Setup

import { ChatClient } from '@chatsdk/core';

const client = new ChatClient({
apiKey: 'your-api-key',
apiUrl: 'https://your-api-server.com',
});

// Connect a user
await client.connectUser(
{ id: 'user-123', name: 'Alice' },
'jwt-token'
);

// Query channels
const channels = await client.queryChannels();

// Send a message
await client.sendMessage('channel-id', { text: 'Hello!' });

Features

  • Real-time messaging - WebSocket-based with Centrifugo
  • Offline support - Messages queue when offline, sync when online
  • Sequence-based sync - Gap detection and automatic recovery
  • Rich messages - Text, images, files, voice notes
  • Reactions - Emoji reactions with real-time updates
  • Typing indicators - See when users are typing
  • Read receipts - Delivered and read status
  • Mentions - @user mentions with notifications
  • Threads - Reply to messages in threads
  • Search - Full-text message search

Packages

PackageDescription
@chatsdk/coreCore SDK with sync engine
@chatsdk/reactReact hooks and components
@chatsdk/react-nativeReact Native components
iOS SDKNative Swift SDK

Guides

Examples