Skip to content

Blazor Server - What is the recommended best practice for additional SignalR functionality? #63695

@btsetworks

Description

@btsetworks

Hey .NET AspNetCore & Blazor Team,

We love Blazor! Keep up the good work.

We have a question for you about best practice for adding additional SignalR functionality into our existing Blazor Server App?

I am seeing mixed responses online about best practices on this, and need your guidance.

In our Blazor Server app (.NET 9), we have several components that need to refresh the UI when background server processing occurs (e.g., receiving a message, processing background results, message/notification/task count, etc.).

  1. Should the Blazor Server components use HubConnectionBuilder to connect to the SignalR hub as the logged-in user (via impersonation with Access Token)?

(or)

  1. Should we NOT use HubConnectionBuilder and instead use the Browser Client (Client Cookies, JavaScript Signal R, with Blazor interop) to process the Signal R events?

The SignalR connection needs to be secure and authenticated (so we can send User-Specific SignalR messages).

What is the best practice here? Or are both options okay to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and servers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions