-
Clone this plugin repository
-
Create a backstage app (outside the plugin repository). If you already have one, skip this step.
npx @backstage/create-app
- Link the react libraries from backstage to the plugin with the following commands
# Go to the root of the Backstage app/repository
yarn link --cwd node_modules/react
yarn link --cwd node_modules/react-dom
yarn link --cwd node_modules/react-router-dom
yarn link --cwd node_modules/react-router
yarn link --cwd node_modules/@material-ui/core
# Go to the root of the plugin repository
sh yarn-links.sh
- Add the plugin to the Backstage app
# Go to the root of the Backstage repository
yarn add --cwd packages/app backstage-plugin-snyk
- Build your plugin (and watch for changes)
# Go to the root of the plugin repository
yarn build --watch
-
Add the needed components in the Backstage app as the README.md explains
-
Add Snyk configuration to the Backstage app
proxy:
endpoints:
/snyk:
target: https://api.snyk.io/
headers:
User-Agent: tech-services/backstage-plugin/1.0
Authorization: token ${SNYK_TOKEN}
snyk:
# Set to "false" to use the real API
mocked: true
- Make sure to add annotations to an entity so the plugin shows in the entity page
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: example-website
annotations:
snyk.io/org-id: 57059599-0459-4443-9cac-3116b5fb5549
snyk.io/project-ids: 33afab43-260a-498e-4432-f556843d2ebe
- You can now start the Backstage app and work in both repositories to see the changes in real time!
# Root of the Backstage repository
yarn dev