From 3745ca582e371c43fa2b6fe34cce4beef9c6129d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= <2493377+askpt@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:53:10 +0100 Subject: [PATCH 1/3] Add OFREP provider integration details to flagd documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com> --- .../docs/integrations/devtools/flagd/flagd-get-started.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx b/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx index 794043233..9a4719eed 100644 --- a/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx +++ b/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx @@ -85,9 +85,16 @@ Getting there is a two-step process: model the flagd resource in your AppHost, t + + ## See also - [flagd documentation](https://flagd.dev/) - [OpenFeature documentation](https://openfeature.dev/) +- [OFREP specification](https://openfeature.dev/specification/appendix-c/) - [Aspire Community Toolkit](https://github.com/CommunityToolkit/Aspire) - [Aspire integrations overview](/integrations/overview/) From 857520ddbb642dbbbed9657214b8d93db5e5d3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= <2493377+askpt@users.noreply.github.com> Date: Wed, 1 Apr 2026 17:03:33 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../docs/integrations/devtools/flagd/flagd-get-started.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx b/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx index 9a4719eed..6e64045c9 100644 --- a/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx +++ b/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-get-started.mdx @@ -87,7 +87,7 @@ Getting there is a two-step process: model the flagd resource in your AppHost, t From d89426bb07ece89e6aadc8df5b0982a19c47fcab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= <2493377+askpt@users.noreply.github.com> Date: Wed, 13 May 2026 14:36:45 +0100 Subject: [PATCH 3/3] Add documentation for connecting to flagd using the OFREP provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com> --- .../devtools/flagd/flagd-connect.mdx | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-connect.mdx b/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-connect.mdx index 0c103ae56..76d42da64 100644 --- a/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-connect.mdx +++ b/src/frontend/src/content/docs/integrations/devtools/flagd/flagd-connect.mdx @@ -220,3 +220,69 @@ For more information, see the [OpenFeature JavaScript SDK](https://openfeature.d + +## Use OFREP provider + +As an alternative to the native provider, you can connect to flagd using the [OFREP (OpenFeature Remote Evaluation Protocol)](https://openfeature.dev/specification/appendix-c/). OFREP is a standardized HTTP/REST-based protocol for remote feature flag evaluation, making it language-agnostic and well-suited for polyglot environments. + +### Install the OFREP provider + +Install the [📦 OpenFeature.Providers.Ofrep](https://www.nuget.org/packages/OpenFeature.Providers.Ofrep) NuGet package in the client-consuming project: + +```powershell +dotnet add package OpenFeature.Providers.Ofrep +``` + +### Configure the app host + +In your app host project, retrieve the OFREP endpoint from the flagd resource and pass it to your consuming project as an environment variable: + +```csharp title="C# — AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var flagd = builder.AddFlagd("flagd") + .WithBindFileSync("./flags/"); + +var ofrepEndpoint = flagd.GetEndpoint("ofrep"); + +builder.AddProject() + .WaitFor(flagd) + .WithEnvironment("OFREP_ENDPOINT", ofrepEndpoint); + +// After adding all resources, run the app... +``` + +### Configure the client + +In the `Program.cs` file of your client-consuming project, register the OpenFeature SDK with the OFREP provider using dependency injection: + +```csharp +using OpenFeature.Providers.Ofrep; +using OpenFeature.Providers.Ofrep.DependencyInjection; + +builder.Services.AddOpenFeature(featureBuilder => +{ + featureBuilder.AddOfrepProvider(); +}); +``` + +The OFREP provider automatically reads the `OFREP_ENDPOINT` environment variable to discover the flagd OFREP endpoint. You can then evaluate feature flags by injecting `IFeatureClient`: + +```csharp +using OpenFeature; + +app.MapGet("/", async (IFeatureClient flagClient) => +{ + var welcomeBanner = await flagClient.GetBooleanValueAsync( + "welcome-banner", + defaultValue: false); + + var backgroundColor = await flagClient.GetStringValueAsync( + "background-color", + defaultValue: "#000000"); + + return Results.Ok(new { welcomeBanner, backgroundColor }); +}); +``` + +For more information on the OFREP specification, see the [OFREP specification](https://openfeature.dev/specification/appendix-c/).