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

Target with flags

Read time: 2 minutes
Last edited: Nov 12, 2024

Overview

This category explains how to use flag targeting to control which of your customers receive which variation of a feature flag. Configuring flags to serve different variations to different end users, or "contexts," is called "flag targeting."

LaunchDarkly contexts are data objects representing users, devices, organizations, and other entities that interact with your app. These data objects contain context attributes that describe what you know about that context, such as their name, location, device type, or organization they are associated with. LaunchDarkly SDKs can pass any context attributes you want to LaunchDarkly, where you can then use those attributes in flag targeting.

In addition to targeting specific context attributes, you can target individuals, segments, or specific mobile apps and devices. You can also release features based on custom rules you create. You can even set expiration dates for flag targeting if you know you only want customers to receive a flag for a specific period of time.

Here are example targeting rules on a feature flag:

Targeting rules on a feature flag.
Targeting rules on a feature flag.

Each feature flag can include a combination of individual targets and targeting rules. Each feature flag must include a default rule.

To learn more about how your application and LaunchDarkly SDKs work together to serve feature flag variations, read LaunchDarkly architecture.

Migration flags are different

Migration flags show different information on their Targeting tab than feature flags do. A migration flag's Targeting tab shows information about the migration's health and the cohorts it is targeted to. To learn more, read Migration flags.

The topics in this category explain how to create and manage different types of targeting rules and default flag variations:

  • Targeting rules
  • Flag prerequisites
  • The off variation
  • The default rule