A Swagger-like UI for exploring and documenting SignalR hubs in ASP.NET Core applications.
- 🔍 Automatic discovery of SignalR hubs and strongly-typed client interfaces
- 📝 Method documentation with parameters and return types
- 🎨 Beautiful Swagger-inspired dark theme UI
- 🔌 Easy integration with minimal configuration
- 📡 Live view of client method invocations from server (via strongly-typed interfaces)
The HubDocs UI in action — exploring hubs, invoking methods, and seeing real-time client logs.
🔍 Interactive method parameter inputs with \"Try it\" support
📡 Live client method logging with JSON preview
📭 No methods found — HubDocs will show helpful instructions if a hub is registered without a route.
dotnet add package HubDocs- Mark your SignalR hubs with the
[HubDocs]attribute:
using HubDocs;
[HubDocs]
public class ChatHub : Hub<IChatClient>
{
// ... your hub methods
}- Register your hubs and add HubDocs in your ASP.NET Core application:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSignalR();
var app = builder.Build();
// Register your SignalR hubs
app.MapHub<ChatHub>("/hubs/chat");
// Add HubDocs - discovers hubs with [HubDocs] attribute
app.AddHubDocs();
app.Run();- Access the HubDocs UI at
/hubdocs/index.htmlor/hubdocs/in your browser.
public interface IChatClient
{
Task ReceiveMessage(string user, string message);
Task Connected(string connectionId);
}
[HubDocs] // Mark for documentation
public class ChatHub : Hub<IChatClient>
{
public async Task SendMessage(string user, string message)
{
await Clients.All.ReceiveMessage(user, message);
}
public override async Task OnConnectedAsync()
{
await Clients.Caller.Connected(Context.ConnectionId);
}
}Note: To fully leverage HubDocs, your hubs should implement
Hub<T>with a strongly-typed client interface (T) that defines the client-callable methods. HubDocs will automatically extract and render both hub and client method metadata in the UI.
HubDocs will automatically discover and display:
- Hub name and full type name
- Route where the hub is registered
- All public methods with parameters and return types
- Client methods from strongly-typed interface
- Interactive UI for exploring the hub
// Register hubs with MapHub
app.MapHub<ChatHub>("/hubs/chat");
// Add HubDocs
app.AddHubDocs();Scan specific assemblies for hubs:
app.AddHubDocs(typeof(ExternalHub).Assembly);Only hubs marked with [HubDocs] attribute are documented. This provides control over which hubs appear in the UI.

