No results for ""
EXPAND ALL
  • Home
  • API docs

GIVE DOCS FEEDBACK

Custom flags

Read time: 2 minutes
Last edited: May 01, 2024

Overview

This topic explains how to get started with custom flags.

While LaunchDarkly provides flag creation templates for the common flag templates discussed in this category, we expect that you will need other flags as well. For ideas and examples of other flags and their use cases, read our guide on Creating new flags.

Default flag settings only apply to custom flags

When you create a new flag in the LaunchDarkly UI, you can choose to start with a flag template, or create a custom flag. Each flag template has its own custom default settings that you cannot alter. Only custom flags are affected by the default flag settings you configure at the project level.

To learn more about default flag settings, read Projects.

To create a custom flag:

  1. Navigate to the flags list.
  2. Click Create flag. The "Create new flag" page appears.
  3. Enter a unique, human-readable Name.
  4. (Optional) Update the flag Key. You'll use this key to reference the flag in your code. A suggested key auto-populates from the name you enter, but you can customize it if you wish.
  5. (Optional) Enter a Description of the flag. A brief, human-readable description helps your account members understand what the flag is for.
  6. (Optional) Check the Include flag in this project's release pipeline box. To learn more, read Release pipelines.
  7. (Optional) Choose any Metrics to monitor in the Metrics section. To learn more, read Metrics.
  8. Choose the Custom flag template in the Configuration section:
The "Configuration" section of the "Create new flag" page.
The "Configuration" section of the "Create new flag" page.
  1. Choose Yes or No to indicate whether this flag is temporary.
  2. Select a flag type:
    • Boolean: optionally update the Name of the true and false variations.
    • String: enter a Value for each variation, and optionally update the Name of each variation. To add more variations, click +Add variation.
    • Number: enter a Value for each variation, and optionally update the Name of each variation. To add more variations, click +Add variation.
    • JSON: enter a Value for each variation, and optionally update the Name of each variation. To add more variations, click +Add variation.
  3. (Optional) In the "Variations" section, create variations for each experiment treatment.
  4. (Optional) Update the default variations.
  5. Choose one or more tags from the Tags menu.
  6. Check the SDKs using Mobile Key and/or SDKs using client-side ID boxes to indicate which client-side SDKs you will use to evaluate this flag. If you are using a server-side SDK, leave these boxes unchecked.
  7. Click Create flag.

To learn more, read Creating new flags.

Then, set up the targeting rules for your flag. To learn how, read Target with flags.