🧩 Client Library

Grimoire.Consumer is a standalone .NET 10 library for consuming the Grimoire API from within your applications.


In this section

Page What you’ll learn
Configuration Provider Inject Grimoire configs as IConfiguration
Secret Client Fetch individual secrets programmatically
Feature Flags Evaluate feature flags locally, alone or behind Microsoft.FeatureManagement
CLI grimoire dotnet tool: read secrets, export to .env, run any program with its secrets injected

Overview

The library provides three ways to consume Grimoire:

Class Use when
GrimoireConfigurationClient You want configs (and optionally secrets) to be part of IConfiguration
GrimoireSecretClient You need fine-grained control — fetch a secret at a specific point in code
GrimoireFeatureFlagClient You check feature flags (locally evaluated; also usable through Microsoft.FeatureManagement)

The first two are in the Grimoire.Consumer namespace and the flag client in Grimoire.Consumer.FeatureFlags. The library has no dependencies on the Grimoire server-side projects.


Adding the library

Install the Grimoire.Consumer package from NuGet.org:

1
dotnet add package Grimoire.Consumer

Or reference the project directly when working inside this repository:

1
2
<!-- In your app's .csproj -->
<ProjectReference Include="path/to/Grimoire.Consumer/Grimoire.Consumer.csproj" />

Azure compatibility

The consumer API response shapes match Azure Key Vault and Azure App Configuration, so you can point the client library at either Grimoire or Azure without changing your application code.


Table of contents