Official package · Frameworks
SignalR-style hubs for ASP.NET Core and Blazor
Write hubs with the SignalR API you already know: Clients.All, groups, users, typed hubs and IHubContext. Your server keeps handling hub calls, and no WebSocket server, backplane or Azure SignalR Service is needed.
Hibira.AspNetCoreNuGet ↗GitHub ↗
- HibiraHub works like SignalR’s Hub, and MapHibiraHub<T>() maps it next to your other endpoints.
- Hibira.Client has the SignalR client API for Blazor WebAssembly, Blazor Server, MAUI and console apps; hibira-hub.js does the same in the browser.
- The Hibira package triggers events, signs channels, verifies webhooks and asks for approvals. .NET 8 and later.
Sign in to see these snippets with your own cluster host. Sign in
Install
dotnet add package Hibira.AspNetCore --version 0.1.0 dotnet add package Hibira.Client --version 0.1.0 # Blazor or other .NET clients dotnet user-secrets set Hibira:AppId YOUR_APP_ID dotnet user-secrets set Hibira:Key YOUR_APP_KEY dotnet user-secrets set Hibira:Secret YOUR_APP_SECRET dotnet user-secrets set Hibira:Host ws.hibira.ioSet it up
using Hibira.AspNetCore; public class ChatHub : HibiraHub { public Task SendMessage(string user, string message) => Clients.All.SendAsync("ReceiveMessage", user, message); } // Program.cs builder.Services.AddHibira(); // reads the "Hibira" section var app = builder.Build(); app.UseStaticFiles(); // serves hibira-hub.js app.MapHibiraHub<ChatHub>("/hubs/chat");Use it
// A Blazor component: Microsoft's SignalR tutorial with one using changed @using Hibira.Client @inject NavigationManager Navigation @code { private HubConnection? hub; private readonly List<string> messages = new(); protected override async Task OnInitializedAsync() { hub = new HubConnectionBuilder() .WithUrl(Navigation.ToAbsoluteUri("/hubs/chat")) .WithAutomaticReconnect() .Build(); hub.On<string, string>("ReceiveMessage", (user, message) => { messages.Add($"{user}: {message}"); InvokeAsync(StateHasChanged); }); await hub.StartAsync(); } }
Before you start
- The app secret is shown only once, when you create the app or rotate its secret. Keep it on your server, never in a browser or game build.
- On the Free plan, list every origin your pages load from in the app’s allowed origins (https://localhost:5001 while developing, then your domain). "*" needs a paid plan.
Use the app key from your dashboard; the secret stays on your server. Channels, events and authorization endpoints work exactly as they do with Pusher. Create your free account →