Summary
This feature request aims to enhance the OpenFeature .NET SDK by enabling the addition of event handlers to the global instance of OpenFeature using Dependency Injection (DI) syntax. This will align the SDK with common DI practices and improve its integration capabilities.
Additional Context:
As part of the DI library, the proposed implementation is expected to follow a syntax similar to the example below:
builder.Services.AddOpenFeature(openfeatureBuilder =>
{
openfeatureBuilder.AddHostedFeatureLifecycle()
.AddProvider(_ => new FlagdProvider())
.AddEventHandler(_ => new OpenFeatureEventHandler());
});
This addition allows developers to seamlessly configure the OpenFeature global instance and integrate event handlers using fluent builder methods.
Check https://openfeature.dev/docs/reference/concepts/events/#event-handlers for more information.