Grimoire.Consumer 2.23.0

dotnet add package Grimoire.Consumer --version 2.23.0
                    
NuGet\Install-Package Grimoire.Consumer -Version 2.23.0
                    
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="Grimoire.Consumer" Version="2.23.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Grimoire.Consumer" Version="2.23.0" />
                    
Directory.Packages.props
<PackageReference Include="Grimoire.Consumer" />
                    
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 Grimoire.Consumer --version 2.23.0
                    
#r "nuget: Grimoire.Consumer, 2.23.0"
                    
#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 Grimoire.Consumer@2.23.0
                    
#: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=Grimoire.Consumer&version=2.23.0
                    
Install as a Cake Addin
#tool nuget:?package=Grimoire.Consumer&version=2.23.0
                    
Install as a Cake Tool

Grimoire.Consumer

.NET client for Grimoire, the self-hosted Vault & Configuration Manager.

  • Configuration provider: load every configuration entry for an environment into IConfiguration with one call.
  • Secret client: fetch individual versioned secrets on demand.
  • Feature flags: evaluate flags locally (percentage rollouts, A/B/n, user and attribute targeting), directly or through Microsoft.FeatureManagement.
  • Azure-compatible shapes: the consumer API mirrors Azure Key Vault and Azure App Configuration responses.

Install

dotnet add package Grimoire.Consumer

Load configuration into IConfiguration

using Grimoire.Consumer;

var builder = WebApplication.CreateBuilder(args);

builder.Configuration.AddGrimoire(
    baseUrl:     "https://grimoire.example.com",
    apiKey:      builder.Configuration["Grimoire:ApiKey"]!,
    environment: "production");

var dbHost = builder.Configuration["Database:Host"];

Entries are loaded once at startup and work with IOptions<T> as usual.

To reload when values change in Grimoire, turn on refresh. The provider polls the Sentinel and Global:Sentinel keys (a 304 when nothing changed) and reloads when Grimoire publishes changes. IOptionsMonitor<T> sees the new values:

builder.Configuration.AddGrimoire(o => o
    .Connect("https://grimoire.example.com", apiKey, "production")
    .ConfigureRefresh(r => r.SetRefreshInterval(TimeSpan.FromSeconds(30))));

Fetch a secret

using Grimoire.Consumer;

var secrets = new GrimoireSecretClient(
    "https://grimoire.example.com", apiKey, "production");

var secret = await secrets.GetSecretAsync("DatabasePassword");
Console.WriteLine(secret.Value);

Feature flags

using Grimoire.Consumer.FeatureFlags;

var flags = new GrimoireFeatureFlagClient(new GrimoireFeatureFlagOptions
{
    BaseUrl = "https://grimoire.example.com",
    ApiKey = apiKey,
    Environment = "production",
});

var user = new FlagContext("u-123").With("country", "IE");
if (await flags.IsEnabledAsync("new-checkout", user)) { /* … */ }
var variant = await flags.GetVariantAsync("checkout-redesign", user);

Definitions are cached and refreshed in the background; checks never wait on the network once loaded, and keep working if Grimoire is down. With Microsoft.FeatureManagement:

builder.Services.AddGrimoireFeatureManagement(o => { o.BaseUrl = "…"; o.ApiKey = "…"; o.Environment = "production"; });

Documentation

Full docs, including the server setup and API reference: https://guibranco.github.io/grimoire-api/

License

MIT

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
2.23.0 83 11/26/2026
2.22.0 91 11/24/2026
2.21.1 83 11/24/2026
2.21.0 85 11/24/2026
2.20.0 89 11/24/2026
2.19.1 95 11/23/2026
2.19.0 90 11/23/2026
2.18.2 95 11/23/2026
2.18.1 87 11/23/2026
2.18.0 85 11/23/2026
2.17.0 90 11/23/2026
2.16.1 87 11/23/2026
2.16.0 87 11/23/2026
2.15.0 86 11/23/2026
2.14.0 90 11/23/2026
2.13.0 92 11/23/2026
2.12.0 86 11/23/2026
2.11.0 87 11/23/2026
2.10.0 87 11/23/2026
2.9.1 84 11/23/2026
Loading failed