> ## Documentation Index
> Fetch the complete documentation index at: https://backstage.spotify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Publishing Plugins

> Publish custom Backstage plugins privately to your Portal Cloud instance using npm registry tokens and CI/CD pipelines.

## Publish a plugin privately

To publish a plugin to Portal Cloud, [contact Spotify](https://backstage.spotify.com/account/support/) to receive a publishing token for your Portal Cloud instance.

Next, set up your local environment to publish to your Portal Cloud instance:

1. Configure your plugin's `package.json` to add a `registry` key:

```json title="package.json" theme={"theme":{"light":"github-light","dark":"dracula"}}
{
 "name": "@portal-internal/plugin-example",
 "version": "0.1.0",
 ...
 "publishConfig": {
   "registry": "https://<company>.spotifyportal.com/api/plugin-installer/registry/npm"
 },
 ...
}
```

2. Add a `.yarnrc.yml` with the `npmAuthToken` key defined with an environment variable:

```yaml theme={"theme":{"light":"github-light","dark":"dracula"}}
npmAuthToken: ${PORTAL_PUBLISHING_TOKEN}
```

3. Export the publishing token you received from Spotify:

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
export PORTAL_PUBLISHING_TOKEN=<token>
```

4. Build your plugin:

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# From a monorepo root directory
$ yarn tsc && yarn build:all

# From the plugin directory
$ yarn tsc && yarn build
```

5. Publish your plugin:

```bash theme={"theme":{"light":"github-light","dark":"dracula"}}
# From a monorepo root directory
yarn workspace @portal-internal/plugin-example npm publish

# From the plugin directory
yarn npm publish
```

6. Repeat Step 5 for any other plugin packages (e.g. backend or common packages).

When publishing subsequent versions, be sure to increment the `version` field in your `package.json` file. This can be done manually, or with a change management tool like [changesets](https://github.com/changesets/changesets).

## Publish a plugin as an Authorized Portal Partner

To become an authorized Portal Partner, please start by [submitting an application](https://info.backstage.spotify.com/partner-interest), and someone from our partnerships team will reach out. Please include all details on the plugin that you have built, including how you intend to maintain support of the published plugin.

After publishing, see [Managing Plugins](/portal/managing-plugins/) for instructions on installing, updating, and uninstalling your plugin in Portal. For details on versioning and update detection, see [Plugin Versioning](/portal/managing-plugins/plugin-versioning).
