Welcome to the LaunchDarkly plugin! It allows you to view feature flags on an entity page in Backstage for either a Project in a tab or a specific context in an entity card.
Add a proxy configuration for LaunchDarkly in the app-config.yaml
file
proxy:
'/launchdarkly/api':
target: https://app.launchdarkly.com/api
headers:
Authorization: ${LAUNCHDARKLY_API_KEY}
In the packages/app/src/components/catalog/EntityPage.tsx
under overviewContent
add the following:
<EntitySwitch>
<EntitySwitch.Case if={isLaunchdarklyContextAvailable}>
<EntityLaunchdarklyContextOverviewCard />
</EntitySwitch.Case>
</EntitySwitch>
In the packages/app/src/components/catalog/EntityPage.tsx
under serviceEntityPage
add the following:
<EntityLayout.Route path="/launch-darkly-projects" title="LaunchDarkly">
<EntityLaunchdarklyProjectOverviewContent />
</EntityLayout.Route>
Set the LAUNCHDARKLY_API_KEY
environment variable and run the backstage backend.
Create an entity with the following annotations and import it:
---
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'
Add the additional annotations in order to filter flags by tags and/or query
---
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'
Roadie gives you a hassle-free, fully customisable SaaS Backstage. Find out more here: https://roadie.io.