> 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/npm.md).

# Configuring npm

npm reads registry configuration from `.npmrc` files (global, per-user, and per-project). We recommend a per-project `.npmrc` in the repository root so the configuration is version-controlled with the manifest.

## Configuration

Create or edit `.npmrc` in the project root:

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

Replace `<project-id>` with the Seal [Project ID](/getting-started/creating-a-seal-project.md#project-id-and-project-name) as a literal value. Replace `<token-base64>` with the base64 encoding of your production token:

```bash
echo -n "$SEAL_TOKEN" | base64        # macOS
echo -n "$SEAL_TOKEN" | base64 -w0    # Linux
```

npm decodes the `_password` field with base64. The raw token is not a valid base64 string even though it looks like one, so the encoding step is mandatory.

The `.npmrc` may still refer to other registries for privately scoped packages. Only the default registry is replaced.

## Verify

```bash
npm -d ping
```

A successful response shows the ping going through `https://npm.sealsecurity.io/`:

```
npm notice PING https://npm.sealsecurity.io/
npm notice PONG
```

## Related

* [Editing dependency files manually](/using-platform/working-with-seal-apps/artifact-server/npm.md): pinning the sealed version in `package.json`, with direct and transitive (`overrides`) examples.
