Create Your First Flag
In this guide, you will learn how to create your first feature flag using FFlags.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure that you have the following:
- An FFlags account and organization setup.
-
Create a Group
FFlags allows you to organize your flags into groups. Traditionally, you will have different environments, such as
development
,staging
, andproduction
. In FFlags, you can create groups to organize your flags based on your requirements. For example,prod_frontend
,dev_backend
,staging_backend
, etc.Once you have created your organization, you can create a group by clicking on the
Add Group
button in the sidebar. Type the name of the group and click on theCreate
button. -
Create a Flag
On creating a group, you will see an option to create a flag with the CTA “Click to add a flag”. Click on the button to create a new flag.
-
Rename the Flag
You can rename the flag by editing the
flag:
field. Give your flag a meaningful name that describes the feature it controls. -
Write the Flag Logic
You can write the flag logic in the code editor. The flag logic is written in JavaScript and should return a
boolean
,string
,number
or anobject
value. -
Apply the Changes
Once you have written the flag logic, click on the
Apply Changes
button to save the flag group. -
All done!
You have successfully created your first feature flag using FFlags.