LaunchDarkly logo

Backstage LaunchDarkly Plugin

LaunchDarkly feature flags associated to software in the catalog

Created by Roadie

Available on Roadie@roadiehq/backstage-plugin-launchdarkly

Set up Backstage in minutes with Roadie

Installation steps

Install the plugin into Backstage.

cd packages/app
yarn add @roadiehq/backstage-plugin-launchdarkly

Add proxy configurations in the app-config.yaml file

// app-config.yaml
proxy:
  # ...
  '/launchdarkly/api':
    target: https://app.launchdarkly.com/api
    headers:
      Authorization: ${LAUNCHDARKLY_API_KEY}

Add the EntityLaunchdarklyContextOverviewCard

// packages/app/src/components/catalog/EntityPage.tsx
<EntitySwitch>
  <EntitySwitch.Case if={isLaunchdarklyContextAvailable}>
    <EntityLaunchdarklyContextOverviewCard />
  </EntitySwitch.Case>
</EntitySwitch>

Add the EntityLaunchdarklyProjectOverviewContent

// packages/app/src/components/catalog/EntityPage.tsx
<EntityLayout.Route path="/launch-darkly-projects" title="LaunchDarkly">
  <EntityLaunchdarklyProjectOverviewContent />
</EntityLayout.Route>

Add the appropriate LaunchDarkly contexts and keys to your entity pages.

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: launchdarklytest
  annotations:
    launchdarkly.com/project-key: default
    launchdarkly.com/environment-key: test
    launchdarkly.com/context: '{ "kind": "tenant", "key": "blah", "name": "blah" }'
spec:
  type: service
  lifecycle: unknown
  owner: 'group:engineering'

You can add filter-tags and filter-query annotations to reduce the volume of flags returned

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: launchdarklytest
  annotations:
    launchdarkly.com/project-key: default
    launchdarkly.com/environment-key: test
    launchdarkly.com/context: '{ "kind": "tenant", "key": "blah", "name": "blah" }'
    launchdarkly.com/filter-tags: '["tagged-flag"]'
    launchdarkly.com/filter-query: 'dark-mode'
spec:
  type: service
  lifecycle: unknown
  owner: 'group:engineering'

Found a mistake? Update these instructions.

Things to know

Authentication

The LaunchDarkly API uses token-based authentication so in order to retrieve results you will need it. To generate an API token, go to https://docs.launchdarkly.com/home/account/api.

Set up Backstage in minutes with Roadie