Configuration reference
Every option of the client config, the hub config, the calls, and the provider.
This page lists every option with its type and default. The concept pages explain how the options work together.
Client config
You pass these options to createSignalRClient. They are the global defaults for all hubs.
Prop
Type
BuilderContext is { hub: string; baseUrl: string }.
The options transport, skipNegotiation, and maxConnectRetries do not exist at the top level or per hub. transport and skipNegotiation belong in httpOptions. maxConnectRetries does not exist, because the library retries until the hub stops. createSignalRClient throws an error when it finds one of them.
Hub config
Each value in hubs can override the global options for one hub. The global value is the fallback.
Prop
Type
Each hub value also holds events and methods. Declare each event with event<[...args]>(), and each method with method<[...args], Return>().
skipNegotiation: true in httpOptions needs transport set to HttpTransportType.WebSockets. Any other value throws an error when you create the client: Hub "<hub>": skipNegotiation needs httpOptions.transport = HttpTransportType.WebSockets.
A binary protocol object with transport set to HttpTransportType.ServerSentEvents throws an error when you create the client.
Invoke options
You pass these options to the invoke helper of a method.
Prop
Type
The Calls page explains the default retry rule.
Teardown options
Prop
Type
The teardown sender resolves false when the hub did not connect within the timeout, the session is disabled, the hub failed, or send rejected. The send helper resolves false when the hub is not connected, or when send() rejects.
Provider values
The values that you pass to provideSignalR are in Provider.
In Angular, baseUrl, enabled, and connectionKey also accept a Signal or a getter. accessTokenFactory accepts a plain function or a Signal of one. Without onError, errors go to the Angular ErrorHandler.
Status values
A hub has one of five statuses: "idle", "connecting", "connected", "reconnecting", and "disconnected". Connection status explains each value and the transitions.
Retry timing
| Layer | Delays | Limit |
|---|---|---|
| SignalR auto-reconnect | The reconnect delays. The default is 0, 2, 10, and 30 seconds. | The end of the delay list. |
| Library rebuild | min(2500 × attempt, 30000) ms | None while the hub is wanted. It stops on a non-retriable error. |
The connect errors 400, 401, 403, and 404 are non-retriable. Every other status code and error retries, for example 0, 408, 429, and 5xx.