• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
No results for ""
EXPAND ALL

EDIT ON GITHUB

Flag prerequisites

Read time: 1 minute
Last edited: Dec 15, 2021
Flag prerequisites is an Enterprise feature

Flag prerequisites is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Overview

This topic explains how to use feature flag prerequisites to enable or disable features based on different states.

Understanding flag prerequisite relationships

Prerequisites allow you to control feature dependencies in LaunchDarkly. You can make flags depend on other flags being enabled to take effect themselves, making them prerequisites to enable a feature. To meet a prerequisite, the prerequisite flag must be On, and the user must receive the variation you specify.

You can manage prerequisites in the feature flag's Targeting tab:

The flag's Targeting tab.
The flag's Targeting tab.

In the example above, the "Pricing tier" flag is a prerequisite of the "Markdown List" flag. The "Markdown List" flag will not be evaluated for a user unless the "Pricing tier" flag is On and the user receives the true variation. If a user receives the false variation of the "Pricing tier" flag, LaunchDarkly does not consider the prerequisite met.

Prerequisite flags must be on

To meet a prerequisite, the prerequisite flag must be On. LaunchDarkly considers the prerequisite unfulfilled if the prerequisite flag is off, regardless of the value being served.

Flags can be dependent on multiple prerequisite flags. If a dependent flag has multiple prerequisite flags, then all of the prerequisite flag requirements must be met for LaunchDarkly to evaluate the dependent flag for a user.

LaunchDarkly automatically prevents you from saving changes that would introduce circular dependencies between prerequisites. For example, you cannot make Flag A a prerequisite of Flag B and also make Flag B a prerequisite of Flag A.

Deleting flags with prerequisites

You cannot delete a flag that is a prerequisite for other flags. You must remove the dependency before you can delete the prerequisite flag.