-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[docs]: Document changes for legacy token deprecation and GAT bypass 2FA configuration #1764
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
25ffc7a
[update]: `legacy` access token creation workflow from access tokens …
jpg619 8bf878f
docs: Update GAT documentation (#1762)
karenjli accd8c1
Update legacy token removed warning message
karenjli 26239c2
Update based on PR comments
karenjli 1a7a1cd
Add note about npm token CLI command
karenjli 3171c06
Add warning to 2FA bypass
karenjli 270567c
Fix linting
karenjli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,10 +13,7 @@ redirect_from: | |
|
|
||
| An access token is an alternative to using your username and password for authenticating to npm when using the API or the npm command-line interface (CLI). An access token is a hexadecimal string that you can use to authenticate, and which gives you the right to install and/or publish your modules. | ||
|
|
||
| There are two types of access tokens available: | ||
|
|
||
| - [Legacy tokens](#about-legacy-tokens) | ||
| - [Granular access tokens](#about-granular-access-tokens) | ||
| As of November 2025, only [Granular access tokens](#about-granular-access-tokens) are supported. Legacy access tokens have been removed. | ||
|
|
||
| You can create access tokens to give other tools (such as continuous integration testing environments) access to your npm packages. For example, GitHub Actions provides the ability to store [secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets), such as access tokens, that you can then use to authenticate. When your workflow runs, it will be able to complete npm tasks as you, including installing private packages you can access. | ||
|
|
||
|
|
@@ -25,13 +22,19 @@ You can work with tokens from the web or the CLI, whichever is easiest. What you | |
| npm token commands let you: | ||
|
|
||
| - View tokens for easier tracking and management | ||
| - Create new legacy tokens | ||
| - Create new legacy tokens (deprecated) | ||
| - Limit access according to IP address ranges (CIDR) | ||
| - Delete/revoke tokens | ||
|
|
||
| For more information on creating and viewing access tokens on the web and CLI, see "[Creating and viewing access tokens][create-token]". | ||
|
|
||
| ## About legacy tokens | ||
| ## About legacy tokens (Deprecated) | ||
|
|
||
| <Note variant="danger"> | ||
|
|
||
| **Warning:** Legacy access tokens were removed on November 5, 2025. | ||
|
|
||
| </Note> | ||
|
|
||
| Legacy tokens are created with the same permissions as the user who created them. The npm CLI automatically generates and uses a publish token when you run `npm login`. | ||
|
|
||
|
|
@@ -52,10 +55,13 @@ Granular access tokens allow you to restrict access provided to the token based | |
| - Set a token expiration date | ||
| - Limit token access based on IP address ranges | ||
| - Select between **read-only** or **read and write** access | ||
| - Configure a token to **Bypass 2FA** requirements | ||
|
|
||
| You can create up to 1000 granular access tokens on your npm account. You can set how long your token is valid for, at least one day in the future. Each token can access up to 50 organizations, and up to either 50 packages, 50 scopes, or a combination of 50 packages and scopes. Access tokens are tied to users’ permission; hence it cannot have more permission than the user at any point in time. If a user has their access revoked from a package or an org., their granular access token also will have its access revoked from those packages or org. | ||
|
|
||
| When you give a token access to an organization, the token can only be used for managing organization settings and teams or users associated with the organization. It does not give the token the right to publish packages managed by the organization. | ||
|
|
||
| The Bypass 2FA capability applies to tokens with write access and is set to false by default at token creation. When the Bypass 2FA option is set to true, this setting takes precedence over account-level and package-level 2FA settings. This means that even if account-level 2FA is enabled and/or package-level 2FA is required, 2FA will still be bypassed when using the token. | ||
|
||
|
|
||
| [create-token]: creating-and-viewing-access-tokens | ||
| [secure-token]: using-private-packages-in-a-ci-cd-workflow#securing-your-token | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might wanna add another note saying
npm tokenis not deprecated and it will eventually work with Granular tokens.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We removed all the documentation about
npm tokenin https://npm-bb091a8293-15913497.drafts.github.io/creating-and-viewing-access-tokensThis is the current verbiage under
Creating tokens with the CLIWe can change it and mention
npm tokenthere as follow