Access Token Installation Guide
Access tokens provide a secure way to authenticate with the RevoGrid Pro repository, especially useful for CI/CD environments or multi-user repository access. Instead of using password authentication, you can create and manage tokens for secure authorization.
Prerequisites
Before creating access tokens, you must first configure and login to the npm server. Please follow the NPM Installation Guide instructions first.
Creating an Access Token
To create a new token using the command line, run:
npm token create --registry=https://npm.rv-grid.com
You will be prompted for your password. After entering it, a new token will be displayed in the console:
┌──────────┬─────────────────────────┐│ token │ Ihj... │├──────────┼─────────────────────────┤│ user │ your-username │├──────────┼─────────────────────────┤│ cidr │ │├──────────┼─────────────────────────┤│ readonly │ false │├──────────┼─────────────────────────┤│ created │ 2025-03-21T01:02:03.00Z │└──────────┴─────────────────────────┘
Make sure to copy and securely store the token value.
Viewing Access Tokens
To view all your available tokens:
npm token list --registry=https://npm.rv-grid.com
This will display a list of all your active tokens:
┌────────┬─────────┬────────────┬──────────┬────────────────┐│ id │ token │ created │ readonly │ CIDR whitelist │├────────┼─────────┼────────────┼──────────┼────────────────┤│ b54f12 │ eyJhb.… │ 2024-03-21 │ no │ │└────────┴─────────┴────────────┴──────────┴────────────────┘
Removing an Access Token
To remove a token, use its ID from the token list:
npm token delete tokenId --registry=https://npm.rv-grid.com
Using Tokens in Your Project
You can use access tokens by creating a .npmrc
file in your project directory with the following content:
@revolist:registry=https://npm.rv-grid.com//npm.rv-grid.com/:_authToken=YOUR-AUTH-TOKEN
Replace YOUR-AUTH-TOKEN
with the token value you received when creating the token.
Token File Locations
The .npmrc
file can be stored in several locations, which npm checks in the following order:
- Project-specific:
/path/to/your/project/.npmrc
- User-specific:
~/.npmrc
- Global:
$PREFIX/etc/npmrc
- npm built-in:
/path/to/npm/npmrc
CI/CD Integration
For Continuous Integration/Continuous Delivery (CI/CD) systems, you can use access tokens stored in .npmrc
. Add the following to your CI/CD environment’s .npmrc
file:
@revolist:registry=https://npm.rv-grid.com//npm.rv-grid.com/:_authToken=YOUR-AUTH-TOKEN
Multi-user Access
For teams working on the same project, you have two options for repository access:
- Individual Logins: Each developer can use their own credentials to access the repository
- Shared Tokens: Create and share access tokens among team members
Troubleshooting
If you encounter issues with token authentication:
- Verify your token is valid by running
npm token list
- Ensure your
.npmrc
file is properly formatted - Check that you’re using the correct registry URL
- Verify your network can access the npm registry
For additional support or questions, please contact our support team.