BellaBaxter.AspNet.Configuration 0.1.1-preview.136

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

BellaBaxter.AspNet.Configuration

ASP.NET Core IConfiguration provider that polls Bella Baxter for secrets and hot-reloads them into your app — no restart required.

Works with any .NET app that uses IConfiguration: ASP.NET Core, Worker Service, console apps.

Installation

dotnet add package BellaBaxter.AspNet.Configuration

Quickstart

appsettings.json (non-secret config — safe to commit):

{
  "BellaBaxter": {
    "BaxterUrl": "https://api.bella-baxter.io",
    "EnvironmentSlug": "production",
    "PollingInterval": "00:01:00"
  }
}

Program.cs:

var builder = WebApplication.CreateBuilder(args);

// Step 1 — Add Bella secrets as an IConfiguration source
// Reads BaxterUrl + EnvironmentSlug from appsettings.json
// Reads ApiKey from BELLA_BAXTER_API_KEY env var or BellaBaxter__ApiKey
builder.Configuration.AddBellaSecrets();

// Step 2 — Register source-generated typed class in DI (optional)
builder.Services.AddBellaTypedSecrets<BellaAppSecrets>();

// Step 3 — Inject anywhere (typed class, IConfiguration, IOptions<T>)
app.MapGet("/", (BellaAppSecrets s) => Results.Ok(new { s.Port, s.DatabaseUrl }));
app.MapGet("/raw", (IConfiguration config) => Results.Ok(config["DATABASE_URL"]));

Credentials — never in appsettings.json:

Method How
bella sdk run -- dotnet run (recommended for local dev) Injects BELLA_BAXTER_API_KEY + BELLA_BAXTER_URL automatically
.NET User Secrets dotnet user-secrets set "BellaBaxter:ApiKey" "bax-..."
Environment variable BellaBaxter__ApiKey=bax-...

Explicit configuration

builder.Configuration.AddBellaSecrets(o =>
{
    o.BaxterUrl        = "https://api.bella-baxter.io";
    o.EnvironmentSlug  = "production";
    o.ApiKey           = Environment.GetEnvironmentVariable("BELLA_BAXTER_API_KEY")!;
    o.PollingInterval  = TimeSpan.FromSeconds(30);
    o.FallbackOnError  = true; // keep serving cached secrets if Baxter is temporarily unreachable
});

How it works

  1. On startup: GET /api/v1/environments/{slug}/secrets → loads all secrets into IConfiguration
  2. Every PollingInterval: GET /api/v1/environments/{slug}/secrets/version (lightweight version check)
  3. If version changed: fetches full secrets → calls OnReload() → triggers IOptionsMonitor<T>.OnChange()
  4. IConfiguration["MY_SECRET"] always reflects the latest value

Baxter serves secrets from a Redis HybridCache — polling does not hit your cloud provider (AWS/Azure/GCP/Vault) on every request. Cloud costs stay near zero regardless of polling frequency.

Typed secrets with source generator

Combine with BellaBaxter.SourceGenerator for compile-time type safety:

// Injected via DI — typed, IDE-friendly, no magic strings
app.MapGet("/", (BellaAppSecrets s) => new {
    s.DatabaseUrl,   // string
    s.Port,          // int
    s.FeatureFlag,   // bool
});

See the samples for complete working examples.

__ double underscore = section separator

.NET's IConfiguration maps __ to : in key names:

Bella secret key IConfiguration path
DATABASE_URL config["DATABASE_URL"]
ConnectionStrings__Default config["ConnectionStrings:Default"]
Jwt__Secret config["Jwt:Secret"]

This means builder.Services.Configure<JwtOptions>(config.GetSection("Jwt")) maps directly to your Jwt__* secrets.

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 (2)

Showing the top 2 NuGet packages that depend on BellaBaxter.AspNet.Configuration:

Package Downloads
BellaBaxter.Aspire.Configuration

Aspire AppHost integration for Bella Baxter — inject Baxter API connection into Aspire-hosted apps.

BellaBaxter.Maui

.NET MAUI secure secret cache for Bella Baxter. Uses SecureStorage (iOS Keychain, Android EncryptedSharedPreferences, Windows DPAPI) to cache secrets offline.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1-preview.138 36 10/20/2026
0.1.1-preview.137 56 10/19/2026
0.1.1-preview.136 48 10/18/2026
0.1.1-preview.135 54 10/16/2026
0.1.1-preview.134 53 10/15/2026
0.1.1-preview.133 54 10/13/2026
0.1.1-preview.132 50 10/12/2026
0.1.1-preview.131 61 10/10/2026
0.1.1-preview.130 53 10/9/2026
0.1.1-preview.129 54 10/8/2026
0.1.1-preview.128 56 10/7/2026
0.1.1-preview.127 58 10/6/2026
0.1.1-preview.126 60 10/5/2026
0.1.1-preview.124 69 10/2/2026
0.1.1-preview.123 59 10/2/2026
0.1.1-preview.122 81 10/2/2026
0.1.1-preview.121 72 9/28/2026
0.1.1-preview.119 64 9/28/2026
0.1.1-preview.118 59 9/27/2026
0.1.1-preview.117 63 9/26/2026
Loading failed