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
<PackageReference Include="Bielu.AspNetCore.AsyncApi.Scalar.Broker" Version="2.0.0" />
<PackageVersion Include="Bielu.AspNetCore.AsyncApi.Scalar.Broker" Version="2.0.0" />
<PackageReference Include="Bielu.AspNetCore.AsyncApi.Scalar.Broker" />
paket add Bielu.AspNetCore.AsyncApi.Scalar.Broker --version 2.0.0
#r "nuget: Bielu.AspNetCore.AsyncApi.Scalar.Broker, 2.0.0"
#:package Bielu.AspNetCore.AsyncApi.Scalar.Broker@2.0.0
#addin nuget:?package=Bielu.AspNetCore.AsyncApi.Scalar.Broker&version=2.0.0
#tool nuget:?package=Bielu.AspNetCore.AsyncApi.Scalar.Broker&version=2.0.0
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
403anywhere 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 | Versions 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. |
-
net10.0
- Bielu.AspNetCore.AsyncApi.Scalar (>= 2.0.0)
- Scalar.AspNetCore (>= 2.16.17)
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 |