Unleash is the largest open-source feature flagging solution on Github, that gives developers greater control over how to deploy new features. There are 12 official client and server SDKs and 10+ community SDKs available for greater flexibility and control over data and feature management deployment.
One of Unleash’s most requested Enterprise features is now available to all users.
Add strategy constraints to your Unleash today
Strategy constraints give you granular control over who gets to see a specific feature by adding preconditions to one of your activation strategies. You can add preconditions for any Unleash context field. As of version 4.16, Unleash supports 15 different constraint operators, fine-tuned for a number of use cases.
Here’s an example: A gradual rollout strategy could target 50% of a user base. But what if you want to only target users with a company email? For that, you’ll need strategy constraints.
Quickly schedule feature releases and feature availability windows. Target feature rollout to users based on variables like region or email address domain. Generate user demand with time-limited feature releases. There are a ton of ways to use strategy constraints, and this is only scratching the surface.
Any strategy on any feature can have as many strategy constraints as you want. Note that when a strategy is evaluated, all strategy constraints must be met for the strategy to pass.
You’ll find that, in most cases, strategy constraints replace the need for custom activation strategies. This means that you no longer need to define custom strategies, then implement them across your SDKs.
Open the constraints menu
Find and select the edit strategy button on the strategy you are working with.
Click the "add constraint" button to open the constraints menu.
Add and configure the constraint
- From the "Context Field" dropdown, select the context field you would like to constrain the strategy on. Choose a constraint operator.
- Define the values to use for this constraint. The operator you select determines whether you can define one or multiple values and what format they can have.
- Save the constraint, then save the strategy.
If you want to update an existing constraint, find the constraint in the edit strategy screen and use the constraint’s edit button.
Because strategy constraints use Unleash context fields, make sure you pass the relevant context to your client SDK. Read more in the SDK section of our the SDK section of the strategy constraints documentation.
While strategy constraints are now free to all users, you won’t have access to the feature unless you upgrade to version 4.16. For users with versions 4.0 and above, you can grab the latest version from the Docker hub. Users of earlier versions should reference our migration guide before upgrading.
Feel free to play around first! Try out our demo instance to get a quick taste of what strategy constraints can do.
In the mood to dig around? Visit Unleash on GitHub to check out the strategy constraints source code.