Sockudo
Realtime Clients

Realtime clients

Choose the official Sockudo realtime client SDK for web, mobile, desktop, Flutter, Kotlin, Swift, JavaScript, or .NET.

Realtime client SDKs connect to Sockudo over WebSocket, subscribe to channels, receive events, authorize protected channels through your backend, and expose Protocol V2 features.

Official clients

SDKPackageRuntimeDefault
JavaScript / TypeScript@sockudo/clientWeb, Node, worker, React, Vue, React Native, NativeScriptProtocol V1 compatibility
SwiftSockudoSwiftiOS, macOS, tvOS, watchOS, visionOSProtocol V1 compatibility
Kotlinio.sockudo:sockudo-kotlinAndroid and JVMProtocol V1 compatibility
Flutter / Dartsockudo_flutterFlutter and DartProtocol V1 compatibility
.NET realtimeSockudo.Client.NET appsProtocol V2 by default

Use Protocol V1 when migrating existing Pusher clients. Use Protocol V2 for recovery, rewind, delta compression, tag filters, mutable messages, annotations, and native Sockudo metadata.

Client responsibilities

Client SDKs should:

  • connect with public app key only
  • call your backend for private, presence, encrypted, push, and history proxy operations
  • keep app secrets out of the client bundle
  • bind events and update UI state
  • store recovery positions when V2 recovery is enabled
  • register devices for push through trusted backend endpoints

Server responsibilities

Server SDKs should:

  • publish events over the HTTP API
  • sign channel and user authentication responses
  • proxy presence history and versioned message reads for clients
  • validate webhooks
  • manage push registration, credentials, channel push subscriptions, and publish workflows

Common V2 setup

const client = new Sockudo("app-key", {
  wsHost: "realtime.example.com",
  forceTLS: true,
  protocolVersion: 2,
  connectionRecovery: true,
});

Push from clients

Mobile and browser clients can collect provider tokens, but they should not call Sockudo push admin APIs directly. Send provider tokens to your backend, bind them to the authenticated user, and let the backend call Sockudo.

await fetch("/api/push/devices", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    device_id: "browser-device-1",
    platform: "webpush",
    provider_token: subscription,
  }),
});

Next steps

On this page