Centrifugo real-time for Tauri 2 apps

Connect, subscribe, publish, RPC, history and presence from your Tauri frontend or backend, on desktop, Android and iOS.

What you get

  • Official SDK inside
    Built on centrifuge-client: reconnects with backoff, ping/pong liveness, wake-from-sleep detection.
  • WebSocket + HTTP streaming
    JSON or Protobuf over WebSocket, with an optional HTTP-streaming fallback and custom headers.
  • Recovery and deltas
    Recoverable and positioned subscriptions, resume from a saved stream position, fossil delta compression.
  • Token bridge
    The SDK asks your frontend for connection and subscription tokens before they expire.
  • Rust backend
    Use the same client from Rust, or the SDK itself as tauri_plugin_centrifugo::centrifuge.
  • Generated reference
    Every function, type, Tauri command and permission, built from the sources on each release.

Connect, listen, publish

Connect once, listen to centrifugo:* events and publish JSON. Reconnects, token refresh and recovery are handled by the SDK.
main.ts
import { connect, onConnected, onMessage, helpers } from "tauri-plugin-centrifugo-api";

await onConnected(({ payload }) => console.log("connected, client", payload.client));
await onMessage(({ channel, data }) => console.log(channel, data));   // parsed JSON

await connect({
  url: "ws://localhost:8000/connection/websocket",
  channels: ["news"],
  useProtobuf: false,
});

await helpers.waitForConnection();
await helpers.publishJson("news", { text: "hello" });