Creating a Feature Flag
Overview
This guide walks you through creating a Feature Flag in AppFlags.
Creating a Feature Flag
To create a Feature Flag:
On the dashboard, click on the "Add Feature Flag" button.
This will launch the form for creating a new Feature Flag:
Enter a human-readable Name for the Feature Flag.
Enter a unique Key for the Feature Flag. You will use this key to refer to the Feature Flag in your code. (A key will be suggested based on your feature flag name.)
cautionThis key cannot be changed after the Feature Flag is created.
Choose a Variation Type:
boolean
,number
, orstring
. This defines the data type of the Feature Flag's value.Enter Variations. A Variation must have a Value. A Variation can optionally have a Name and a Description.
A
boolean
flag always has two Variations: true and false.A
number
orstring
flag can have any number of Variations. You can add, remove, or change these Variations in the future.
Select a Default Variation. This sets the Variation the Feature Flag will have after being created.
Click "Create".
You have now created your first Feature Flag!
Environments
When a Feature Flag is created, it is set to the default Variation in all Environments. You can then change the Feature Flag targeting rules individually in each Environment.
By default, a project has Environments for staging
and production
. You can create more Environments as you need for your project.