Soenneker.SignalR.Web.Client 4.0.808

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.SignalR.Web.Client --version 4.0.808
                    
NuGet\Install-Package Soenneker.SignalR.Web.Client -Version 4.0.808
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.SignalR.Web.Client" Version="4.0.808" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.SignalR.Web.Client" Version="4.0.808" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.SignalR.Web.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.SignalR.Web.Client --version 4.0.808
                    
#r "nuget: Soenneker.SignalR.Web.Client, 4.0.808"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.SignalR.Web.Client@4.0.808
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.SignalR.Web.Client&version=4.0.808
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SignalR.Web.Client&version=4.0.808
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.SignalR.Web.Client

A SignalR client wrapper that retries initial connections, recovers closed connections, and exposes callbacks for restoring application state after a connection returns.

Installation

dotnet add package Soenneker.SignalR.Web.Client

Usage

using Microsoft.AspNetCore.Http.Connections;
using Soenneker.SignalR.Web.Client;
using Soenneker.SignalR.Web.Client.Options;

var options = new SignalRWebClientOptions
{
    HubUrl = "https://api.example.com/hubs/updates",
    AccessTokenProvider = () => Task.FromResult(accessToken),
    TransportType = HttpTransportType.WebSockets,
    ConnectionRestored = async context =>
    {
        // Reload authoritative state after the initial connection or a reconnect.
        await SynchronizeAsync(context.IsReconnect);
    },
    RetriesExhausted = () => NotifyConnectionFailure()
};

await using var client = new SignalRWebClient(options);

client.Connection.On<OrderUpdated>("OrderUpdated", update =>
{
    Apply(update);
});

await client.StartConnection(cancellationToken);
await client.Connection.InvokeAsync("Subscribe", accountId, cancellationToken);

The wrapper owns its HubConnection; dispose the wrapper when the connection is no longer needed. Use Connection to register handlers with On(...) and call hub methods with InvokeAsync(...).

Reconnection behavior

Each connection cycle retries a failed start up to MaxRetryAttempts times using exponential backoff. After an unexpected close, ReconnectIndefinitely starts another cycle after InitialRetryDelay; set it to false to stop after the first exhausted cycle. RetriesExhausted is invoked when recovery stops, and ConnectionRestored runs after both an initial connection and a successful recovery.

Enable StatefulReconnect only when the server supports it. StatefulReconnectBufferSize controls the client-side buffered message bytes used by that mode.

Call StopConnection for an intentional disconnect. This suppresses closed-connection recovery until StartConnection is called again.

Authentication and headers

AccessTokenProvider is evaluated by SignalR when it needs a bearer token. Static request headers can be supplied through Headers; avoid placing secrets in headers that may be sent by transports or intermediaries you do not control.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.SignalR.Web.Client:

Package Downloads
Soenneker.SignalR.Web.Clients

Providing async thread-safe resilient and dependable SignalR web client singletons

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.810 28 9/1/2026
4.0.809 96 8/31/2026
4.0.808 85 8/30/2026
4.0.807 73 8/30/2026
4.0.806 90 8/30/2026
4.0.805 88 8/30/2026
4.0.804 86 8/30/2026
4.0.803 86 8/30/2026
4.0.802 76 8/29/2026
4.0.801 72 8/29/2026
4.0.800 79 8/29/2026
4.0.799 77 8/29/2026
4.0.798 145 8/26/2026
4.0.797 393 8/12/2026
4.0.796 108 8/11/2026
4.0.795 260 7/28/2026
4.0.794 135 7/28/2026
4.0.793 99 7/28/2026
4.0.792 126 7/27/2026
4.0.791 101 7/27/2026
Loading failed

Improve SignalR client usage guidance