3. Create a multiple variants feature flag
Create feature flag
To create a feature flag with multiple variants, follow these steps:
- Navigate to the Feature Flags page.
- Click on the "+ Add" button located at the top right corner.
- Name the feature flag "difficulty mode".
- Configure the flag as follows:
- Choose string as the Variation type.
- Add three variants:
easy
,normal
, andhard
.
- If the flag is turned OFF, it serves the
easy
value. - If the flag is turned ON, it serves the
normal
value. - By default, this flag is set to
OFF
.
Then click the "Save" button to create the feature flag.
Interacting with the demo
Back to the demo page, click the "Next Task" button, the Dino Game demo will show you how to change the game difficulty.
Follow the instructions in the image above, change the rule, you will see the change happens in the game area.
Next
You have successfully completed the task of creating feature flags and interacting with the demo. In the upcoming topics, you will learn more about: