LaunchDarkly Developer Documentation

Get started in under 30 minutes.
LaunchDarkly provides feature flags as a service for Java · Python · Ruby · Go · Node.js · PHP · .NET. Control feature launches -- who sees what and when -- without multiple code deploys. Easy dashboard for phased rollouts, targeting and segmenting.
Need more help? write us at support@launchdarkly.com

Get Started    Guides

Creating a feature flag

LaunchDarkly makes feature flag creation easy. First, navigate to your feature flag dashboard and click "New". This will prompt you to create a feature flag.

In the "Create a feature flag" area, you can specify attributes for your new feature flag, including name, description, and type. These attributes help you manage the feature flag and customize it to your use case.

A. Name your feature flag
Give your feature flag a meaningful name

B. Specify a flag key
Specify the key that you will use to reference the flag in your code. You may customize the key to anything you like, so long as it does not duplicate an existing key.

C. Describe your flag
Provide a meaningful human-readable description of the flag. This will help your team members understand the flag's purpose.

D. Add tags
One or more labels to help you categorize the flag. This is especially helpful for managing flag permissions using custom roles. For example, you can tag a flag as "Marketing" and "DevOps", and then use these tags to determine who has read or write access for the flag.

E. Specify the flag type
Choose either boolean or multivariate for the flag type. A boolean flag has two variations true and false, which works best for feature flags that will simply turn things on and off. A multivariate flag allows you to define two or more custom variations. These variations can be strings, numbers, JSON objects, or JSON arrays. The type of variation value is detected automatically based on your input, and cannot be changed after the flag has been created. You will always have the option to return strings. You will specify the value for each variation (ex. one-click-checkout) with the option to add a human-readable name and description.

F. Settings
"This is a permanent flag"
Mark the flag as permanent if you intend it to keep it in your code long-term (ex. a flag to enable maintenance mode). We will not prompt you to remove permanent flags, even if one variation has been rolled out to all of your users.

"Make this flag available to the client-side"
By default, feature flags cannot be used on the front-end of your application. With this option, you can control which flags are available to the JavaScript SDK, iOS SDK, and Android SDK.

When you create a feature flag, the flag is scoped to the project. This means that all environments within a project have the same set of feature flags. The flag configuration settings are specific to each environment.

From the UI, you can select the project and environment where you'd like to update your flag configuration using the environment switcher at the top left corner of the screen:

Clone a flag
You can also create a feature flag by cloning an existing flag. Go to the settings page of the flag you wish to clone and click clone this flag. When you clone a flag, LaunchDarkly will make a new flag and copy the full targeting configuration for all environments (including on/off state) from the original flag to the new flag.