SDKs & API overview

One wire protocol. Three first-class SDKs.

Rust is the reference engine; Kotlin shares it natively through UniFFI, and TypeScript is an idiomatic WebSocket implementation. All SDKs implement the same wire protocol, with cross-language codec fixtures.

Developer experience

Connect, authenticate, subscribe — the core loop.

The snippets below show the real API shapes: connect, authenticate, subscribe. For a full build, start from each repository README.

TypeScript API overview
$ # npm package coming soon — build from source: github.com/privchat/privchat-sdk-typescript

import { PrivchatClient } from "@privchat/sdk";

const client = new PrivchatClient({
  url: "wss://im.example.com:9080/",
});

await client.connect();
await client.authenticate(userId, accessToken, deviceId);

await client.subscribeChannel("900710001", 1);
client.onPushMessage((message) => {
  console.log("new message", message.server_message_id);
});

The three tracks

One protocol underneath, idiomatic on top.

Pick the language that fits your surface — the wire contract is shared, so every SDK speaks the same protocol to the same server.

Rust Core

The reference client engine: actor command queue, SQLite and Sled local storage, sync, event broadcast, and the FFI surface.

TypeScript

Browser and desktop runtime with typed codecs, RPC sugar, event replay, auto-reconnect, and token refresh built in.

Kotlin Multiplatform

Android and native targets backed by the Rust engine via UniFFI — one engine underneath every mobile app.

Capability matrix

Capabilities across the current SDK family.

These are shipped capabilities, not a wishlist — the roadmap strip below is where future tracks live until they are real.

Platforms

  • Web (WebSocket)
  • Android via Kotlin
  • iOS via Kotlin/Native FFI
  • Desktop via TypeScript
  • Cocos & game engines

Connection

  • Auto-reconnect
  • Token refresh flow
  • Multi-transport via Rust core (WS on web)
  • Connection state machine
  • End-to-end heartbeat

Data

  • Local-first storage
  • Message sync & recovery
  • Server-authoritative pts
  • Event replay
  • Typed codecs

Extensibility

  • Transfer RPC calls
  • Channel subscribe & publish
  • Push message hooks
  • Bot & system-user APIs
  • FFI surface for new hosts
RoadmapSwift SDKGo service SDKFlutter bindingsUnity adapterCloud offeringHosted console

Next step

Start from the guide paths and repositories.

Follow the guide paths into each repository — server, SDKs, and protocol — and build from the READMEs.

Open tutorials