Skip to content

Function: createWebSocketSubscription()

createWebSocketSubscription(options): (onPoke) => () => void

Defined in: client/src/sync/websocket.ts:71

Build a subscribe implementation compatible with PlasmaClientOptions.subscribe. On start it opens a WebSocket to the plasma SyncCoordinator and fires onPoke() whenever a poke message arrives. The connection auto-reconnects with exponential backoff and unsubscribes cleanly on stop.

createPlasmaClient({
...,
subscribe: createWebSocketSubscription({ url: "wss://api/sync/coordinator" }),
})

WebSocketSubscriptionOptions

(onPoke) => () => void