Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI should be able to use a token for a scope only #707

Open
lukekarrys opened this issue Sep 19, 2023 · 0 comments
Open

CLI should be able to use a token for a scope only #707

lukekarrys opened this issue Sep 19, 2023 · 0 comments

Comments

@lukekarrys
Copy link
Contributor

Problem Statement

The CLI should be able to use additional tokens for a single registry and separate them by scope. This is not currently possible. Meaning if you have public and private scoped packages on the same registry, you must use the same token for both.

Possible Solution

.npmrc

//registry.npmjs.org/:_authToken=<TOKEN_A>
registry=https://registry.npmjs.org/
@npmcorp:_authToken=<TOKEN_B>
@npm:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<TOKEN_C>

Given the above .npmrc file the CLI should be able to run the following commands:

npm publish semver # would use TOKEN_A on https://registry.npmjs.org/
npm install @npmcorp/hello # would use TOKEN_B on https://registry.npmjs.org/
npm install @npm/hello # would use TOKEN_C for https://npm.pkg.github.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant