Show the LaunchDarkly tab on a component
Components get a LaunchDarkly tab: their feature flags. The card of Administration βΊ Plugins says: Feature flags of an entity, read through the proxy.
Three steps: turn on the plugin, give it the address and the key of LaunchDarkly, annotate the component.
1. π Turn on the pluginβ
-
In Administration, under PLATFORM, click Plugins.
-
On the LaunchDarkly card, click the switch Enable LaunchDarkly.
2. π§ Give the plugin the address and the keyβ
-
On the LaunchDarkly card, click Configure. The Settings page of the plugin opens.
-
Fill in the form:
Field What to enter Example API URL The LaunchDarkly API root, with https://https://app.launchdarkly.com/apiAPI key The API key LaunchDarkly expects. It stays in the backend: the browser never talks to LaunchDarkly. -
Click Save. The message Settings saved. appears at the bottom left of the screen and goes away by itself. The page says The configuration has changed.
-
Click Reload. The instance restarts; wait a few seconds. The fields stay filled, and the API key shows as
XXXXXXXXXXXX.
3. π·οΈ Annotate the componentβ
In the component's catalog-info.yaml, name the LaunchDarkly project:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: shop-api
annotations:
launchdarkly.com/project-key: shop-api # the project key in LaunchDarkly
spec:
type: service
lifecycle: production
owner: group:default/platform-team
β Checkβ
Open the component from Catalog: the LaunchDarkly tab is after Docs. Once the settings are saved, the tab no longer says LaunchDarkly is not configured yet; it asks LaunchDarkly for the flags. What the tab shows when LaunchDarkly accepts the key was not checked on a live instance.
β That's it!