Prerequisites allow you to control feature dependencies in LaunchDarkly. In other words, you can add a list of flags and their expected values as prerequisites to enable a feature.
Let's say we have two flags that control an API:
api_writes. In this case, it makes no sense to have write access to the API if you do not have read access.
With prerequisites, you can make sure that
api_reads is On with the user receiving
api_writes is evaluated for that user.
You can manage your prerequisites in the feature flag's Targeting tab:
To meet a prerequisite, the prerequisite flag must be On, and the current user must receive the specified variation.
LaunchDarkly will automatically detect circular dependencies when you add a prerequisite.
Note that if flag A has flag B as a prerequisite, then callers relying on flag A need to also include all user attributes needed to evaluate flag B, in addition to any user attributes normally supplied for flag A.
Deleting Flags With Prerequisites
You cannot remove a flag that other flags are dependent on. You must first remove the dependency before the flag can be deleted.