Skip to content

Interface: UsePresenceOptions

Defined in: react/src/use-presence.ts:18

Configuration for usePresence. Mirrors the subset of WebSocketSubscriptionOptions that presence consumers care about — the hook manages the connection lifecycle.

readonly url: string | undefined

Defined in: react/src/use-presence.ts:23

Full wss://…/sync/coordinator URL. When absent presence is disabled and the hook returns an empty list.


readonly optional room?: string

Defined in: react/src/use-presence.ts:25

Room key. Defaults to "global".


readonly optional token?: string | (() => string | Promise<string>)

Defined in: react/src/use-presence.ts:30

Coordinator shared secret. Function form is re-invoked on reconnect so callers can refresh a rotating token.


readonly optional userInfo?: unknown

Defined in: react/src/use-presence.ts:38

The userInfo payload broadcast to peers. Change with care — the hook re-establishes the WebSocket when this changes because v1.0 coordinator has no in-session update path. See the Presence guide for the cadence caveat.


readonly optional clientID?: string

Defined in: react/src/use-presence.ts:43

Presence identifier for this tab. When omitted the coordinator assigns one and the local me result reflects that.