Configure npm
Global configuration
Section titled “Global configuration”Add the following to ~/.npmrc to route all requests through Pure’s registry:
registry=https://registry.pure.devThis 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.
Per-project configuration
Section titled “Per-project configuration”Create a .npmrc file at the root of your project (next to package.json):
registry=https://registry.pure.devCommit this file to version control so everyone on the team uses the same registry.
Scoped packages only
Section titled “Scoped packages only”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.devAll other packages continue to resolve from the default (npmjs.org or whatever your top-level registry is set to).
Authentication for private packages
Section titled “Authentication for private packages”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:
echo "//registry.pure.dev/:_authToken=${PURE_REGISTRY_TOKEN}" >> ~/.npmrcYarn and pnpm
Section titled “Yarn and pnpm”Yarn (Berry)
Section titled “Yarn (Berry)”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.devOr per-scope:
@my-org:registry=https://registry.pure.dev