Skip to main content
This topic describes how to install the LaunchDarkly developer toolbar. You can install and configure the toolbar directly in your codebase, and use it in your browser during local development.
Do not use the toolbar in productionYou should use the toolbar only in a local dev environment. Do not render it in hosted or production environments.

Prerequisites

To begin using the developer toolbar, you need:

Installation

Depending on your package manager, install the toolbar package using one of the following methods:
Then, install the developer toolbar using one of the following methods:
  • React
  • Vue
  • Angular
  • using a CDN
The Developer Toolbar depends on your LaunchDarkly JavaScript client having a reference to the same FlagOverridePlugin and EventInterceptionPlugin that you pass into the developer toolbar. Be sure that that you instantiate the toolbar at the same time or immediately after you initiate the client.

Install using React

If you develop your front end using React, the @launchdarkly/toolbar package provides a React hook to configure and lazily-load the developer toolbar.After you install the package, navigate to the area of your application where you instantiate your LaunchDarkly React client. The developer toolbar uses two plugins to power its functionality, and those plugins also need to be passed into the LaunchDarkly React client.To do this:

Install using Vue

After you install the package, navigate to the area of your application where you instantiate your LaunchDarkly Vue client and install the following:

Install using Angular

After you install the package, navigate to the area of your application where you instantiate your LaunchDarkly client and install the following:

Install using a CDN

If you are not using React, Vue, or Angular as your front-end framework, or want to use the developer toolbar in a way where it is decoupled from your tech stack and its dependencies, you can also instantiate the toolbar using a CDN.To do so, add this script to your index.html file:
This attaches LaunchDarklyToolbar to your window and exposes an init() method using window.LaunchDarklyToolbar.init() that will lazily load the developer toolbar in the same way the React hook does.In your corresponding code, wherever you instantiate your LaunchDarkly JavaScript client, pass in the following plugins:
If you are using TypeScript and want type-safety for the window.LaunchDarklyToolbar.init call, you can add a window.d.ts file to the root of your web application with the following:

Mode options

The developer toolbar supports running in two different modes:
  • SDK mode: Integrates with your LaunchDarkly SDK for local flag overrides and testing
  • Dev server mode: Connects to a LaunchDarkly CLI dev server for flag browsing and real-time updates
SDK mode is the default mode for the toolbar. The toolbar switches to dev server mode only if you provide devServerUrl. Generally, we recommend SDK mode.

Available features by mode

ModeOptions
SDK modeFlag overrides (if you provide flagOverridePlugin)
Events (if you provide eventInterceptionPlugin)
Settings
Dev server modeFlags
Settings

Set up SDK mode

SDK mode integrates directly with your LaunchDarkly client, allowing you to:
  • Override flag values locally without affecting other members
  • Test different flag variations instantly
  • Work offline or with any LaunchDarkly environment
Setup requires the following steps:
  1. Create a FlagOverridePlugin instance
  2. (Optional) Create an EventInterceptionPlugin instance
  3. Pass the plugin into your LaunchDarkly SDK’s plugins array
  4. Pass the same plugin instance into the LaunchDarklyToolbar component
  5. Wrap your app with the LDProvider
Here’s how to set up SDK mode:

Set up dev server mode

If your team uses the LaunchDarkly CLI dev server, start it with CORS enabled:
Then connect the toolbar by passing in the URL of the CLI dev server:

Properties

You can set the following properties to personalize the toolbar.

Flag override plugin

The flag override plugin enables flag overrides and testing:
PropTypeDefault
flagOverridePluginIFlagOverridePluginundefined

Event interception plugin

The event interception plugin enables Events tab functionality:
PropTypeDefault
eventInterceptionPluginIEventInterceptionPluginundefined

Base LaunchDarkly URL

You can use the base LaunchDarkly URL for link generation, such as to create a missing feature flag:
PropTypeDefault
baseUrlstring (optional)https://app.launchdarkly.com

LaunchDarkly dev server URL

You can use the URL of your LaunchDarkly dev server to enable dev server mode:
PropTypeDefault
devServerUrlstring (optional)undefined

Toolbar position

You can set the toolbar position on your screen:
PropTypeDefault
positiontop-left | top-right | bottom-left | bottom-right (optional)bottom-right

Project key

You can use a project key in multi-project setups (dev server mode only):
PropTypeDefault
projectKeystring (optional)undefined

Polling interval

You can set the polling interval for dev server updates (dev server mode only):
PropTypeDefault
pollIntervalInMsnumber (optional)5000

Visibility control

The toolbar provides a global API for show/hide control: