> For the complete documentation index, see [llms.txt](https://docs.sealsecurity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealsecurity.io/setup-apps-os/artifact-server/configuring-package-managers/yarn.md).

# Configuring Yarn

Yarn's registry configuration depends on the major version. Classic Yarn (v1) reads `.npmrc` files like npm; Yarn v2+ (Berry) uses `.yarnrc.yml`.

## Classic Yarn (v1)

Yarn v1 reads `.npmrc`. The configuration is identical to [Configuring npm](/setup-apps-os/artifact-server/configuring-package-managers/npm.md):

```ini
registry=https://npm.sealsecurity.io/
//npm.sealsecurity.io/:username=<project-id>
//npm.sealsecurity.io/:_password=<token-base64>
//npm.sealsecurity.io/:always-auth=true
```

`<token-base64>` is the base64 encoding of your token (npm decodes the `_password` field as base64).

## Yarn v2+ (Berry)

Yarn v2 and later use `.yarnrc.yml`. Create or edit the file in the project root:

```yaml
npmRegistries:
  "https://npm.sealsecurity.io":
    npmAlwaysAuth: true
    npmAuthIdent: <auth-ident>

npmRegistryServer: "https://npm.sealsecurity.io"
```

The `<auth-ident>` value depends on the exact Yarn version:

* **Yarn v2**: the base64 encoding of `<project-id>:<token>`, computed as `echo -n "<project-id>:<token>" | base64`.
* **Yarn v3+**: the literal string `"<project-id>:<token>"` (no base64 encoding).

Yarn Berry also requires `yarnPath` to point at the bundled Yarn release in `.yarn/releases/yarn-<version>.cjs`; that line is typically already present in projects using Berry.

## Verify

For Classic Yarn:

```bash
yarn config get registry
```

The output should be `https://npm.sealsecurity.io/`.

For Yarn Berry, run a clean install (`yarn install`) and confirm the resolved packages come from `npm.sealsecurity.io`.

## Related

* [Configuring npm](/setup-apps-os/artifact-server/configuring-package-managers/npm.md): the equivalent setup for npm itself.
* [Editing dependency files manually](/using-platform/working-with-seal-apps/artifact-server/yarn.md): manifest editing with the `resolutions` field (Yarn's transitive-override mechanism).
