Skip to navigation

isConnected$

View as MarkdownOpen in Claude
get isConnected$(): Observable<boolean>

Observable that emits when the connection state changes.

It emits true when connect() succeeds and false when the client disconnects: on disconnect(), or when the server refuses the credential on a reconnect and the SDK stops retrying. It stays true while the SDK reconnects automatically after a dropped socket. To track those reconnects, use ready$.

isConnected

get isConnected(): boolean

Whether the client is currently connected.

Examples

client.isConnected$.subscribe((isConnected) => {
console.log('isConnected:', isConnected);
});