Skip to content

Configure npm

Add the following to ~/.npmrc to route all requests through Pure’s registry:

registry=https://registry.pure.dev

This makes the Pure registry the default for npm install, npm update, and all other npm commands. Packages not found in the Pure registry are automatically fetched from npmjs.org.

Create a .npmrc file at the root of your project (next to package.json):

registry=https://registry.pure.dev

Commit this file to version control so everyone on the team uses the same registry.

If you only want Pure-published scoped packages (e.g. @my-org/...) to come from the Pure registry, scope the override:

@my-org:registry=https://registry.pure.dev

All other packages continue to resolve from the default (npmjs.org or whatever your top-level registry is set to).

If you publish private packages to the Pure registry, npm needs a token to fetch them. Generate a read token in the dashboard under Registry → Tokens → New read token, then add it to ~/.npmrc:

registry=https://registry.pure.dev
//registry.pure.dev/:_authToken=<your-token>

For CI, store the token as a secret and write the .npmrc during the build step rather than committing credentials:

Terminal window
echo "//registry.pure.dev/:_authToken=${PURE_REGISTRY_TOKEN}" >> ~/.npmrc

In .yarnrc.yml:

npmRegistryServer: "https://registry.pure.dev"

For scoped packages only:

npmScopes:
my-org:
npmRegistryServer: "https://registry.pure.dev"

In .npmrc (pnpm reads the same file):

registry=https://registry.pure.dev

Or per-scope:

@my-org:registry=https://registry.pure.dev