Bielu.AspNetCore.AsyncApi.Scalar.Broker 2.0.0

Prefix Reserved
dotnet add package Bielu.AspNetCore.AsyncApi.Scalar.Broker --version 2.0.0
                    
NuGet\Install-Package Bielu.AspNetCore.AsyncApi.Scalar.Broker -Version 2.0.0
                    
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="Bielu.AspNetCore.AsyncApi.Scalar.Broker" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bielu.AspNetCore.AsyncApi.Scalar.Broker" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Bielu.AspNetCore.AsyncApi.Scalar.Broker" />
                    
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 Bielu.AspNetCore.AsyncApi.Scalar.Broker --version 2.0.0
                    
#r "nuget: Bielu.AspNetCore.AsyncApi.Scalar.Broker, 2.0.0"
                    
#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 Bielu.AspNetCore.AsyncApi.Scalar.Broker@2.0.0
                    
#: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=Bielu.AspNetCore.AsyncApi.Scalar.Broker&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Bielu.AspNetCore.AsyncApi.Scalar.Broker&version=2.0.0
                    
Install as a Cake Tool

Bielu.AspNetCore.AsyncApi.Scalar.Broker

Adds an interactive message-broker console to the Scalar API Reference in ASP.NET Core. The console reads the kafka, mqtt and amqp bindings out of your AsyncAPI document(s) and lets you publish to a channel and tail it live, next to the rest of your API documentation.

A browser cannot speak Kafka, MQTT or AMQP, so the console reaches your broker through an opt-in server-side bridge that this package mounts in your app.

Kafka is the only driver that ships today, as Bielu.AspNetCore.AsyncApi.Scalar.Broker.Kafka. mqtt and amqp channels are listed, but they are only offered a connection of the same protocol, so they stay inert until you register a driver for them by implementing IBrokerBridge.

This bridge can publish to your broker. Nothing is exposed until you call MapScalarBrokerAssets(), and outside the Development environment the proxy endpoints refuse unauthenticated callers unless you say otherwise. Read Securing the bridge before deploying it.

Install

This package contains the console and the bridge abstraction; add a driver for the broker you use:

dotnet add package Bielu.AspNetCore.AsyncApi.Scalar.Broker
dotnet add package Bielu.AspNetCore.AsyncApi.Scalar.Broker.Kafka

Usage

builder.Services.AddScalarBrokerBridge(options =>
{
    options.AddKafkaConnection("orders", "localhost:9092");
});

app.MapAsyncApi();

// Serves the console bundle and the publish/tail proxy endpoints.
app.MapScalarBrokerAssets()
   .RequireAuthorization("BrokerConsole");

app.MapScalarApiReference(options =>
{
    options.AddAsyncApiDocument("v1", "Orders", "/asyncapi/v1.json");
    options.WithBrokerClient();
});

MapScalarBrokerAssets() mounts four endpoints under /bielu/scalar/broker (configurable):

Endpoint Purpose
GET {path}/plugin.js The console bundle (the @bielu/scalar-broker build).
GET {path}/connections The registered connections — name, protocol, and a credential-free endpoint label.
POST {path}/publish Publishes one message to a channel.
GET {path}/tail Server-Sent Events stream of messages consumed from a channel.

Securing the bridge

The returned builder covers the three proxy endpoints, so a single RequireAuthorization(...) on the result of MapScalarBrokerAssets() protects all of them. The bundle itself is not covered: it is static JavaScript with no configuration or secrets in it, and it is useless without the proxy.

If the endpoints carry no authorization metadata, the proxy:

  • allows the request in the Development environment, logging a warning once;
  • refuses it with 403 anywhere else, logging how to fix it.

Set AllowAnonymous = true on AddScalarBrokerBridge only when the endpoints are protected by something ASP.NET Core authorization cannot see, such as a network boundary.

Credentials entered in Scalar's auth panel travel with every proxy call — bearer tokens, HTTP Basic, and API keys in a header or query parameter.

Tailing

Tail subscriptions are ephemeral and start at the newest offset: opening a console never disturbs a real consumer group's committed position and never replays a backlog into the browser. The stream is read with fetch + ReadableStream rather than EventSource, because EventSource cannot send the Authorization header the proxy sits behind.

Writing a driver

Implement IBrokerBridge (PublishAsync + TailAsync) and register it with an extension method on ScalarBrokerBridgeOptions that calls AddConnection. See Bielu.AspNetCore.AsyncApi.Scalar.Broker.Kafka for a worked example.

Documentation

Full documentation: https://apidescriptions.bielu.pl/

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 Bielu.AspNetCore.AsyncApi.Scalar.Broker:

Package Downloads
Bielu.AspNetCore.AsyncApi.Scalar.Broker.Kafka

Kafka driver for the interactive Scalar broker console. Lets the console publish to and tail Kafka topics described by your kafka AsyncAPI bindings, through the opt-in server-side bridge in Bielu.AspNetCore.AsyncApi.Scalar.Broker.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 0 10/25/2026
2.0.0-beta.20261025083222 25 10/25/2026
2.0.0-beta.20261025073559 24 10/25/2026
2.0.0-beta.20261024233532 31 10/24/2026
2.0.0-beta.20261024230848 39 10/24/2026
2.0.0-beta.20261024191358 38 10/24/2026
2.0.0-beta.20261024185247 36 10/24/2026
2.0.0-beta.20261024184446 32 10/24/2026
2.0.0-beta.20261024163851 43 10/24/2026
2.0.0-beta.20261024153849 40 10/24/2026
2.0.0-beta.20261024142609 35 10/24/2026
2.0.0-beta.20261024142554 32 10/24/2026
2.0.0-beta.20261024140532 30 10/24/2026
2.0.0-beta.20261024135507 36 10/24/2026
2.0.0-beta.20261024133330 37 10/24/2026
2.0.0-beta.20261024132617 33 10/24/2026
1.4.1-beta.20261018142232 48 10/18/2026
1.4.1-beta.20261018142111 52 10/18/2026
1.4.0 91 10/17/2026
1.4.0-beta.20261017205523 50 10/17/2026
Loading failed