When distributing a Grafana plugin either within the community or privately the plugin must be signed so the Grafana application can verify its authenticity. This can be done with the @grafana/sign-plugin
package.
Note: It's not necessary to sign a plugin during development. The docker development environment that is scaffolded with @grafana/create-plugin
accomodates for running the plugin without a signature.
Before signing a plugin please read the Grafana plugin publishing and signing criteria documentation carefully.
@grafana/create-plugin
has added the necessary commands and workflows to make signing and distributing a plugin via the grafana plugins catalog as straightforward as possible.
Before signing a plugin for the first time please consult the Grafana plugin signature levels documentation to understand the differences between the types of signature level.
- Create a Grafana Cloud account.
- Make sure that the first part of the plugin ID matches the slug of your Grafana Cloud account.
- You can find the plugin ID in the
plugin.json
file inside your plugin directory. For example, if your account slug isacmecorp
, you need to prefix the plugin ID withacmecorp-
.
- You can find the plugin ID in the
- Create a Grafana Cloud Access policy with the
plugins:write
scope. - Create an Access Token for this Access policy
- Keep a record of this token as it will be required for signing a plugin.
If the plugin is using the GitHub actions supplied with @grafana/create-plugin
signing a plugin is included out of the box. The release workflow can prepare everything to make submitting your plugin to Grafana as easy as possible. Before being able to sign the plugin however a secret needs adding to the GitHub repository.
- Please navigate to "settings > secrets > actions" within your repo to create secrets.
- Click "New repository secret"
- Name the secret "GRAFANA_ACCESS_POLICY_TOKEN"
- Paste your Grafana Cloud Access token in the Secret field
- Click "Add secret"
To trigger the workflow we need to push a version tag to GitHub. This can be achieved with the following steps:
- Run
npm version <major|minor|patch>
- Run
git push origin main --follow-tags
Below you can find source code for existing app plugins and other related documentation.