Skip to content

Get started with the GO Feature Flag integrations

⭐ Community Toolkit goff logo

Feature flags let you modify system behavior without changing code. Deploy every day, release when you are ready. Reduce risk by releasing your features progressively.

  • GO Feature Flag believes in simplicity and offers a simple and lightweight solution to use feature flags.
  • Target individual segments, users, and development environments, use advanced rollout functionality.
  • 100% Opensource, no vendor locking, supports your favorite languages and is pushing for standardisation with the support of OpenFeature.

In this introduction, you’ll see how to install and use the Aspire GO Feature Flag integrations in a simple configuration. If you already have this knowledge, see GO Feature Flag hosting integration for full reference details.

To begin, install the Aspire GO Feature Flag hosting integration in your Aspire AppHost project:

Aspire CLI — Add CommunityToolkit.Aspire.Hosting.GoFeatureFlag package
aspire add communitytoolkit-gofeatureflag

The Aspire CLI is interactive, be sure to select the appropriate search result when prompted:

Aspire CLI — Example output prompt
Select an integration to add:
> communitytoolkit-gofeatureflag (CommunityToolkit.Aspire.Hosting.GoFeatureFlag)
> Other results listed as selectable options...

In your app host project, call AddGoFeatureFlag on the builder instance to add a goff container resource:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var goff = builder.AddGoFeatureFlag("goff")
.WithGoffBindMount("./goff");
builder.AddProject<Projects.ExampleProject>()
.WithReference(goff);
// After adding all resources, run the app...

goff uses either the YAML, JSON or TOML format to configure feature flags. The WithGoffBindMount method mounts a local folder into the container where goff reads its flag configuration files.

Next, install the Aspire GO Feature Flag client integration in your client-consuming project:

.NET CLI — Add CommunityToolkit.Aspire.GoFeatureFlag package
dotnet add package CommunityToolkit.Aspire.GoFeatureFlag

In the Program.cs file of your client-consuming project, call the AddGoFeatureFlagClient extension method to register a GoFeatureFlagProvider for use via the dependency injection container:

builder.AddGoFeatureFlagClient(connectionName: "goff");

You can then retrieve the GoFeatureFlagProvider instance using dependency injection. For example, to retrieve the provider from a service:

public class ExampleService(GoFeatureFlagProvider provider)
{
// Use provider...
}

For full reference details, see GO Feature Flag hosting integration and GO Feature Flag client integration.