Keys / npm
NPM_TOKEN
The npm access token CI installs private packages or publishes with.
- Expires
- you choose; write tokens last at most 90 days
- API
- create, list and revoke, with
npm token
Get it
Create one on www.npmjs.com/settings/~/tokens. The steps aren't recorded yet.
Set it
NPM_TOKEN=...
npm doesn't read it by name; your .npmrc refers to it with //registry.npmjs.org/:_authToken=${NPM_TOKEN}. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Generate a new granular access token with the same packages, organizations, permissions, IP ranges and Bypass two-factor authentication setting.
- Deploy it everywhere that reads
NPM_TOKEN. - Check that nothing still uses the old token, then delete it on the Access Tokens page or with
npm token revoke <id>. Revoking can take up to an hour.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.