Get started with the GO Feature Flag integrations
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.
Note
To follow this guide, you must have created an Aspire solution to work with. To learn how to do that, see Build your first Aspire app.
Set up hosting integration
To begin, install the Aspire GO Feature Flag hosting integration in your Aspire AppHost project:
dotnet add package CommunityToolkit.Aspire.Hosting.GoFeatureFlagIn your app host project, call AddGoFeatureFlag on the builder instance to add a goff container resource:
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.
Set up client integration
Next, install the Aspire GO Feature Flag client integration in your client-consuming project:
dotnet add package CommunityToolkit.Aspire.GoFeatureFlagIn 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.