Skip to main content

index/interfaces/StreamWebSocketConfig.md

Stream WebSocket configuration

Properties​

PropertyTypeDescription
autoConnect?booleanOpen the socket when a subscription is registered and none is open (default: true).
reconnectAttempts?numberMaximum reconnection attempts (default: 5; Infinity never gives up)
reconnectDelay?numberDelay before the first reconnection attempt in ms (default: 2000)
reconnectDelayMax?numberLongest delay between reconnection attempts in ms (socket.io's default: 5000)
subscriptionTimeout?numberHow long a room join or an authentication may wait for the server's answer in ms (default: 10000)
tokenProvider?() => Promise<string | null>The JWT to authenticate with, asked for whenever the service authenticates without being handed a token (and on every reconnect). It must answer with the token current at that moment. null: none.
urlstringStream WebSocket server URL (SEPARATE from bundleBaseUrl)