To begin, login to your Rollouts account and on the Features tab, click the New Feature… button.
In the New Feature window, provide the following details:
Feature Key - a unique identifier for the feature. Be sure to use alphanumeric characters, hyphens, and underscores in this unique key. No spaces.
Description - while an optional field, we encourage you to provide a summary of the feature and what is does for ease of identification by the team.
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.
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.
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
userIDcan be any non-null string, more on that shortly.
Create Feature - this saves the feature flag, making it available for implementation in your code.
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.