---
title: "Private registries"
url: https://docs.corefinity.com/guides/sites/code-and-deployments/registry-secrets
type: guide
last_updated: 2026-11-13
feature: registry-secrets
related:
  - https://docs.corefinity.com/api/reference/deployments/list-environment-registry-secrets.md
  - https://docs.corefinity.com/api/reference/deployments/create-environment-registry-secret.md
  - https://docs.corefinity.com/api/reference/deployments/update-environment-registry-secret.md
  - https://docs.corefinity.com/api/reference/deployments/delete-environment-registry-secret.md
  - https://docs.corefinity.com/api/reference/deployments/check-environment-registry-secret.md
  - https://docs.corefinity.com/mcp/tools/corestack_environment_registry_secret_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_environment_registry_secret_set.md
  - https://docs.corefinity.com/mcp/tools/corestack_environment_registry_secret_delete.md
---
# Private registries

Let a site's builds install packages from a private npm scope or a private Composer repository.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can add, verify and delete its registries.
- You have the registry's address and a token for it. The registry must be reachable from the internet over HTTPS.
- Each environment has its own registries: choose **Production** or **Staging** in the site header first.

## Add a registry

1. **Open the site's deployments**

   Go to **Managed Websites**, choose the site, then **Deployments** under **Code & backups**. On the **Private registries** card, choose **Add registry**.

   _Screenshot: The Private registries card with Add registry ringed: a Composer registry with HTTP basic and two npm registries with their scopes, each with a masked token, a Verified mark and when it was last used._

2. **Enter the registry details**

   Choose the **Kind**, fill in its fields and paste the **Token**.

   _Screenshot: The Add a private registry dialog with npm chosen under Kind: the Registry URL and Scope boxes, the Token box with the note Never shown again, and the buttons Cancel, Save and verify, and Save._

3. **Save and verify**

   Choose **Save and verify**. The registry is asked whether it accepts the token, and the row reads **Verified** or **Invalid** with the registry's answer.

The next build of this environment signs in to the registry. The token is never shown again, and it never reaches the site itself.

| Kind         | Fields                                                                                                                                                                                         |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **npm**      | **Registry URL**, an HTTPS address such as `https://npm.pkg.github.com`, and the **Scope**, such as `@acme`. Leave **Scope** blank for the default registry.                                   |
| **Composer** | **Host**, as in `auth.json`, with no `https://` or path, and the **Auth type**: **HTTP basic**, **Bearer**, **GitHub OAuth** or **GitLab token**. **HTTP basic** also asks for a **Username**. |

An environment holds up to 20 registries, one for each address and scope. With none, builds use the public npm and Packagist registries, and the Magento keys and Shopware Store token saved on the site.

## Replace a token, verify or delete

1. **Open the registry's menu**

   Open the registry's **…** menu and choose **Replace token…**, **Verify** or **Delete**.

   _Screenshot: The Private registries card with the first registry's menu open, showing Replace token, Verify and Delete._

**Replace token…** keeps the address and username and asks only for the new token. After **Delete**, builds that install from that registry fail until a token is added again.

## Add a registry for every site

1. **Open the organisation's deployments**

   Go to **Organisation › Organisations**, choose your organisation, then **Deployments** under **Developers**. On the **Private registries** card, choose **Add registry**.

Builds of every site of your organisation sign in to the registry. An environment that sets its own token for the same registry keeps it.

This needs an owner, or a role with **Edit Environment Deployment Pipeline**, and an organisation holds up to 20.

On a CoreStack Enterprise environment, the credentials are on the environment page's **Composer registries** card.

## Automate this

**API:** [Create a site registry secret](https://docs.corefinity.com/api/reference/deployments/create-site-deployment-secret.md), scope `write`

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/deployments/secrets \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "auth_type": "http-basic",
    "kind": "composer",
    "label": "Private packages",
    "registry": "packages.example.com",
    "token": "your-registry-token",
    "username": "northwind-digital"
  }'
```

**MCP:** [`corestack_deployments_secret_set`](https://docs.corefinity.com/mcp/tools/corestack_deployments_secret_set.md), scope `write`

```json
{
  "name": "corestack_deployments_secret_set",
  "arguments": {
    "site_id": 4211,
    "kind": "npm",
    "label": "GitHub Packages",
    "registry": "https://npm.pkg.github.com",
    "scope": "@acme",
    "token": "<the registry token>",
    "verify": true
  }
}
```

**Control Panel:** Managed Websites › your site › Code & backups › Deployments ([https://manage.corefinity.com/go/deployment-variables](https://manage.corefinity.com/go/deployment-variables))

## Related

- [Variables](/guides/sites/code-and-deployments/variables-and-secrets): Give deployment commands a value.
- [Pipeline](/guides/sites/code-and-deployments/pipeline-stages): Change what a deployment runs.
- [Build caches](/guides/sites/code-and-deployments/build-caches): Clear the packages a build has cached.
