Skip to main content

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:

  1. On the dashboard, click on the "Add Feature Flag" button.

    Add feature flag button

  2. This will launch the form for creating a new Feature Flag:

    Feature flag form

  3. Enter a human-readable Name for the Feature Flag.

  4. 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.)

    caution

    This key cannot be changed after the Feature Flag is created.

  5. Choose a Variation Type: boolean, number, or string. This defines the data type of the Feature Flag's value.

  6. 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 or string flag can have any number of Variations. You can add, remove, or change these Variations in the future.

  7. Select a Default Variation. This sets the Variation the Feature Flag will have after being created.

  8. 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.

info

By default, a project has Environments for staging and production. You can create more Environments as you need for your project.