ForgeTrust.AppSurface.Web.Scalar
0.1.0-rc.4
dotnet add package ForgeTrust.AppSurface.Web.Scalar --version 0.1.0-rc.4
NuGet\Install-Package ForgeTrust.AppSurface.Web.Scalar -Version 0.1.0-rc.4
<PackageReference Include="ForgeTrust.AppSurface.Web.Scalar" Version="0.1.0-rc.4" />
<PackageVersion Include="ForgeTrust.AppSurface.Web.Scalar" Version="0.1.0-rc.4" />
<PackageReference Include="ForgeTrust.AppSurface.Web.Scalar" />
paket add ForgeTrust.AppSurface.Web.Scalar --version 0.1.0-rc.4
#r "nuget: ForgeTrust.AppSurface.Web.Scalar, 0.1.0-rc.4"
#:package ForgeTrust.AppSurface.Web.Scalar@0.1.0-rc.4
#addin nuget:?package=ForgeTrust.AppSurface.Web.Scalar&version=0.1.0-rc.4&prerelease
#tool nuget:?package=ForgeTrust.AppSurface.Web.Scalar&version=0.1.0-rc.4&prerelease
ForgeTrust.AppSurface.Web.Scalar
This package integrates the Scalar API Reference UI into AppSurface web applications.
Overview
The AppSurfaceWebScalarModule provides a modern, interactive API documentation interface. It depends on ForgeTrust.AppSurface.Web.OpenApi and maps the Scalar UI when Scalar exposure options and the AppSurface-owned OpenAPI endpoint exposure both allow the active environment.
Release Guidance
AppSurface publishes coordinated v0.1.0 release candidates. Before installing this package from a prerelease feed, read the v0.1.0 RC 4 release note for current release risk, migration guidance, and package readiness.
Usage
Simply add the AppSurfaceWebScalarModule to your module dependencies:
public class MyModule : IAppSurfaceWebModule
{
public void RegisterDependentModules(ModuleDependencyBuilder builder)
{
builder.AddModule<AppSurfaceWebScalarModule>();
}
// ...
}
Features
- Built-in Dependency: Automatically registers the
AppSurfaceWebOpenApiModule. - Controlled UI Mapping: Maps the Scalar API reference endpoint using
MapScalarApiReference()only when exposure options allow it. - OpenAPI-Aware Gate: Requires the AppSurface-owned OpenAPI endpoint to be exposed in the same environment. Scalar never calls
MapOpenApi()itself. - Production-Safe Default: Maps Scalar in Development and hides it in non-development environments unless the host opts in.
Endpoint Exposure
AppSurfaceWebScalarOptions binds from the AppSurfaceWebScalar configuration section.
{
"AppSurfaceWebScalar": {
"ExposeEndpoint": "DevelopmentOnly"
}
}
ExposeEndpoint uses AppSurfaceApiDocumentationEndpointExposure from ForgeTrust.AppSurface.Web.OpenApi:
DevelopmentOnly(0): maps Scalar only whenStartupContext.IsDevelopmentistrue. This is the default.Always(1): allows Scalar in every environment, subject to OpenAPI exposure also being allowed.Never(2): never maps Scalar, including in Development.
For production exposure, opt into both Scalar and OpenAPI:
{
"AppSurfaceWebOpenApi": {
"ExposeEndpoint": "Always"
},
"AppSurfaceWebScalar": {
"ExposeEndpoint": "Always"
}
}
If Scalar is Always but OpenAPI remains DevelopmentOnly in Production, neither the Scalar UI nor the AppSurface-owned OpenAPI endpoint is available through the default module composition. If OpenAPI is Always but Scalar is DevelopmentOnly, the OpenAPI document is available and Scalar stays hidden.
Use Always only when the host intentionally exposes API documentation and protects it with host-owned controls such as authorization, private networking, or a reverse proxy policy. AppSurface only decides whether to map endpoints; it does not add authentication or authorization.
Code-first configuration is also supported:
services.Configure<AppSurfaceWebOpenApiOptions>(options =>
{
options.ExposeEndpoint = AppSurfaceApiDocumentationEndpointExposure.Always;
});
services.Configure<AppSurfaceWebScalarOptions>(options =>
{
options.ExposeEndpoint = AppSurfaceApiDocumentationEndpointExposure.Always;
});
Invalid enum values fail options validation at startup when the options are read.
| 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
- CliWrap (>= 3.10.1)
- ForgeTrust.AppSurface.Web.OpenApi (>= 0.1.0-rc.4)
- Microsoft.AspNetCore.OpenApi (>= 10.0.8)
- Microsoft.Extensions.Hosting (>= 10.0.8)
- Microsoft.Extensions.Logging.Console (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- Scalar.AspNetCore (>= 2.14.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-rc.4 | 57 | 6/16/2026 |
| 0.1.0-rc.3 | 54 | 6/8/2026 |
| 0.1.0-rc.2 | 52 | 6/3/2026 |
| 0.1.0-rc.1 | 51 | 5/31/2026 |
| 0.1.0-preview.4 | 56 | 5/25/2026 |
| 0.1.0-preview.3 | 59 | 5/20/2026 |
| 0.1.0-preview.2 | 56 | 5/14/2026 |