Grimoire.Consumer
2.23.0
dotnet add package Grimoire.Consumer --version 2.23.0
NuGet\Install-Package Grimoire.Consumer -Version 2.23.0
<PackageReference Include="Grimoire.Consumer" Version="2.23.0" />
<PackageVersion Include="Grimoire.Consumer" Version="2.23.0" />
<PackageReference Include="Grimoire.Consumer" />
paket add Grimoire.Consumer --version 2.23.0
#r "nuget: Grimoire.Consumer, 2.23.0"
#:package Grimoire.Consumer@2.23.0
#addin nuget:?package=Grimoire.Consumer&version=2.23.0
#tool nuget:?package=Grimoire.Consumer&version=2.23.0
Grimoire.Consumer
.NET client for Grimoire, the self-hosted Vault & Configuration Manager.
- Configuration provider: load every configuration entry for an environment into
IConfigurationwith 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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Configuration (>= 11.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 11.0.0)
- Microsoft.FeatureManagement (>= 4.8.0)
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 |