Learn Something New: Create a feature flag

To begin, login to your Rollouts account and on the Features tab, click the New Featureā€¦ button.

rollouts new feature
In the New Feature window, provide the following details:

  1. Feature Key - a unique identifier for the feature. Be sure to use alphanumeric characters, hyphens, and underscores in this unique key. No spaces.

  2. Description - while an optional field, we encourage you to provide a summary of the feature and what it does for ease of identification by the team.
    rollouts new feature steps 1 2

  3. Controls - the toggle that turns the flag on/off in the specified environment. To begin, you have both a Production and a Development environment to choose from, with Production as your primary environment. Leave the toggle Off for now and return to this when you are ready to implement the flag in your code. You'll use the slider in the future to set the percentage of users that will see the feature.
    rollouts new feature step 3

  4. Audiences - the group(s) of users to whom the feature will be made available. You can safely develop the feature directly in Production, hide it behind the feature flag, and set the audience to your QA team to limit visibility of the feature while testing.
    rollouts new feature step 4

  5. Example Code - Copy the appropriate API call with your feature key into your code. Optimizely populates the feature key, in each of the supported languages. The userID can be any non-null string, more on that shortly.

  6. Create Feature - this saves the feature flag, making it available for implementation in your code.
    rollouts new feature steps 5 6

Return to this feature whenever you want to update the feature flag and its availability. You can add and remove audiences, toggle the feature on in different environments, roll it out or back, and refer to the example code.