Is there a way for enable/disable feature for all users with Launch Darkly?

729 Views Asked by At

I know there is this tool called Launch Darkly that works like a feature flag manager.

Looking into its docs (https://docs.launchdarkly.com/sdk/client-side/dotnet) I see its possible enable a feature programatically like below:

User user = User.WithKey(user_key);
client = await LdClient.InitAsync("MY_MOBILE_KEY", user);
bool showFeature = client.BoolVariation("your.feature.key", false);

if (showFeature) {
  // Application code to show the feature
}
else {
  // The code to run if the feature is off
}

The point is that I want to enable or disable a feature regardless the user and not for a specific user as the documentation sample shows us.

So my question is: it is possible manage a feature for ALL users at the same time (which means without specifying a specific user)? If yes, how?

I have searched a lot, tried other approachs but nothing useful till now.

Thanks by advance.

1

There are 1 best solutions below

0
On

Yes, it's possible. To do this you need to add a feature flag with the default rule of serving : true. This flag will evaluate to true for all users that encounter it.