ForgeTrust.AppSurface.Web.Scalar 0.1.0-rc.4

This is a prerelease version of ForgeTrust.AppSurface.Web.Scalar.
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
                    
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="ForgeTrust.AppSurface.Web.Scalar" Version="0.1.0-rc.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ForgeTrust.AppSurface.Web.Scalar" Version="0.1.0-rc.4" />
                    
Directory.Packages.props
<PackageReference Include="ForgeTrust.AppSurface.Web.Scalar" />
                    
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 ForgeTrust.AppSurface.Web.Scalar --version 0.1.0-rc.4
                    
#r "nuget: ForgeTrust.AppSurface.Web.Scalar, 0.1.0-rc.4"
                    
#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 ForgeTrust.AppSurface.Web.Scalar@0.1.0-rc.4
                    
#: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=ForgeTrust.AppSurface.Web.Scalar&version=0.1.0-rc.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ForgeTrust.AppSurface.Web.Scalar&version=0.1.0-rc.4&prerelease
                    
Install as a Cake Tool

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 when StartupContext.IsDevelopment is true. 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.


📂 Back to Web List | 🏠 Back to Root

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

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