Scalar.AspNetCore 1.2.4

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Scalar.AspNetCore --version 1.2.4
                    
NuGet\Install-Package Scalar.AspNetCore -Version 1.2.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="Scalar.AspNetCore" Version="1.2.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Scalar.AspNetCore" Version="1.2.4" />
                    
Directory.Packages.props
<PackageReference Include="Scalar.AspNetCore" />
                    
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 Scalar.AspNetCore --version 1.2.4
                    
#r "nuget: Scalar.AspNetCore, 1.2.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 Scalar.AspNetCore@1.2.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=Scalar.AspNetCore&version=1.2.4
                    
Install as a Cake Addin
#tool nuget:?package=Scalar.AspNetCore&version=1.2.4
                    
Install as a Cake Tool

Scalar .NET API Reference Integration

This .NET package Scalar.AspNetCore provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger. Made possible by the wonderful work of captainsafia on building the integration & docs written for the Scalar & .NET integration.

dotnet

🚀 Getting Started

  1. Install the package
dotnet add package Scalar.AspNetCore
  1. Add the using directive
using Scalar.AspNetCore;
  1. Configure your application

Add the following lines to your Program.cs for .NET 9:

builder.Services.AddOpenApi();

if (app.Environment.IsDevelopment())
{
    app.MapOpenApi();
    app.MapScalarApiReference();
}

or for .NET 8 with Swashbuckle:

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

if (app.Environment.IsDevelopment())
{
    app.UseSwagger(options =>
    {
        options.RouteTemplate = "openapi/{documentName}.json";
    });
    app.MapScalarApiReference();
}

That's it! 🎉 Now you will see the Scalar UI when using the defaults by navigating to /scalar/v1 in your browser.

Configuration

The MapScalarApiReference method has an optional parameter that you can use to customize the behavior of the Scalar UI:

// Fluent api
app.MapScalarApiReference(options =>
{
    options
        .WithTitle("My custom API")
        .WithTheme(ScalarTheme.Mars)
        .WithSidebar(false)
        .WithDefaultHttpClient(ScalarTarget.CSharp, ScalarClient.HttpClient)
        .WithPreferredScheme("ApiKey")
        .WithApiKeyAuthentication(x => x.Token = "my-api-key");
});

// Object initializer
app.MapScalarApiReference(options =>
{
    options.Title = "My custom API";
    options.Theme = ScalarTheme.Mars;
    options.ShowSidebar = false;
    options.DefaultHttpClient = new(ScalarTarget.CSharp, ScalarClient.HttpClient);
    options.Authentication = new ScalarAuthenticationOptions
    {
        PreferredSecurityScheme = "ApiKey",
        ApiKey = new ApiKeyOptions
        {
            Token = "my-api-key"
        }
    };
});

For more possible options and their default values, check out the ScalarOptions.cs class.

It is also possible to configure the options via dependency injection, using the options pattern:

builder.Services.Configure<ScalarOptions>(options => options.Title = "My custom API");
// or
builder.Services.AddOptions<ScalarOptions>().BindConfiguration("Scalar");

Options which are set via the MapScalarApiReference method will take precedence over options set via dependency injection.

Building & Release

dotnet build
dotnet pack --configuration Release
# then ping marc until we set up ci auto release!
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (185)

Showing the top 5 NuGet packages that depend on Scalar.AspNetCore:

Package Downloads
Rystem.Api.Server

Rystem.Api helps you to integrate Api Server and Automated Client for Aspect-Oriented programming.

Scalar.AspNetCore.Microsoft

Provides OpenAPI transformers for Microsoft.AspNetCore.OpenApi that enable Scalar-specific extensions in your OpenAPI document.

Scalar.AspNetCore.Swashbuckle

Provides OpenAPI filters for Swashbuckle.AspNetCore.SwaggerGen that enable Scalar-specific extensions in your OpenAPI document.

devprime.stack.web

DevPrime Web

Mii.Rinjani.Gateway.Commons

Package Description

GitHub repositories (79)

Showing the top 20 popular GitHub repositories that depend on Scalar.AspNetCore:

Repository Stars
jasontaylordev/CleanArchitecture
Clean Architecture Solution Template for ASP.NET Core
ardalis/CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
JustArchiNET/ArchiSteamFarm
C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
dotnet/eShop
A reference .NET application implementing an eCommerce site
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 11, 10, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
fullstackhero/dotnet-starter-kit
Production Grade Cloud-Ready .NET 10 Starter Kit (Web API + React Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
FastEndpoints/FastEndpoints
A light-weight REST API development framework for ASP.NET 8 and newer.
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
AIDotNet/OpenDeepWiki
OpenDeepWiki is the open-source version of the DeepWiki project, aiming to provide a powerful knowledge management and collaboration platform. The project is mainly developed using C# and TypeScript, supporting modular design, and is easy to expand and customize.
evolutionary-architecture/evolutionary-architecture-by-example
Navigate the complex landscape of .NET software architecture with our step-by-step, story-like guide. Unpack the interplay between modular monoliths, microservices, domain-driven design, and various architectural patterns. Go beyond the one-size-fits-all solutions and understand how to blend these approaches based on your unique needs.
dotnet/aspnet-api-versioning
Provides a set of libraries which add service API versioning to ASP.NET Core Minimal APIs, Controllers, gRPC, OData, and Web API (Classic).
davidfowl/TodoApp
Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication
ErsatzTV/legacy
Open-source platform that transforms your personal media library into live, custom TV channels.
exceptionless/Exceptionless
Exceptionless application
JasperFx/wolverine
Supercharged .NET server side development!
webprofusion/certify
Professional ACME Client for Windows (and now cross-platform via Certify Management Hub). Certificate Management UI, powered by Let's Encrypt and compatible with all ACME v2 CAs. Used by over 150,000 organisations. Download from certifytheweb.com
GZTimeWalker/GZCTF
The GZ::CTF project, an open source CTF platform.
SteveDunn/Vogen
A semi-opinionated library which is a source generator and a code analyser. It Source generates Value Objects
meysamhadeli/booking-microservices
A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Wolverine, and Aspire in .Net 10.
Version Downloads Last Updated
2.17.2 0 8/28/2026
2.17.1 177,717 8/20/2026
2.16.20 309,938 8/13/2026
2.16.19 56,066 8/13/2026
2.16.18 270,755 8/7/2026
2.16.17 389,555 7/31/2026
2.16.16 662,387 7/20/2026
2.16.15 222,137 7/16/2026
2.16.14 22,211 7/16/2026
2.16.13 77,666 7/15/2026
2.16.12 82,182 7/15/2026
2.16.11 450,245 7/8/2026
2.16.10 320,977 7/3/2026
2.16.9 79,292 7/2/2026
2.16.8 74,916 7/2/2026
2.16.7 323,651 6/30/2026
2.16.6 266,434 6/26/2026
2.16.5 334,235 6/22/2026
2.16.4 436,270 6/17/2026
1.2.4 20,022 9/22/2024
Loading failed