Scalar.AspNetCore
1.2.4
Prefix Reserved
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
<PackageReference Include="Scalar.AspNetCore" Version="1.2.4" />
<PackageVersion Include="Scalar.AspNetCore" Version="1.2.4" />
<PackageReference Include="Scalar.AspNetCore" />
paket add Scalar.AspNetCore --version 1.2.4
#r "nuget: Scalar.AspNetCore, 1.2.4"
#:package Scalar.AspNetCore@1.2.4
#addin nuget:?package=Scalar.AspNetCore&version=1.2.4
#tool nuget:?package=Scalar.AspNetCore&version=1.2.4
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.
🚀 Getting Started
- Install the package
dotnet add package Scalar.AspNetCore
- Add the using directive
using Scalar.AspNetCore;
- 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 | Versions 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. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (158)
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 (78)
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
|
|
|
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.
|
|
|
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.
|
|
|
dotnet/aspnet-api-versioning
Provides a set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core.
|
|
|
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, Masstransit, and Aspire in .Net 10.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.16.4 | 45,974 | 6/17/2026 |
| 2.16.3 | 159,511 | 6/11/2026 |
| 2.16.2 | 73,484 | 6/9/2026 |
| 2.16.1 | 17,492 | 6/9/2026 |
| 2.14.14 | 1,035,287 | 5/14/2026 |
| 2.14.13 | 14,926 | 5/14/2026 |
| 2.14.11 | 527,830 | 5/5/2026 |
| 2.14.10 | 75,418 | 5/5/2026 |
| 2.14.9 | 187,151 | 4/30/2026 |
| 2.14.8 | 89,828 | 4/29/2026 |
| 2.14.7 | 17,964 | 4/29/2026 |
| 2.14.6 | 150,035 | 4/27/2026 |
| 2.14.5 | 133,876 | 4/27/2026 |
| 2.14.4 | 204,300 | 4/23/2026 |
| 2.14.3 | 122,274 | 4/22/2026 |
| 2.14.2 | 15,574 | 4/21/2026 |
| 2.14.1 | 211,590 | 4/18/2026 |
| 2.14.0 | 138,318 | 4/16/2026 |
| 2.13.22 | 262,509 | 4/11/2026 |
| 1.2.4 | 18,988 | 9/22/2024 |