Use npm trusted publishers
Problem
Currently, when publishing npm packages to the npm registry, we still depend on the NPM_TOKEN secret to be set at the repo or org level.
However, npm recently added support for trusted publishers, which should help us remove that dependency on the npm token usage: https://github.blog/changelog/2025-07-31-npm-trusted-publishing-with-oidc-is-generally-available/
Normally the releaser should be compatible as long as we use npm >= 11.5.1: https://github.com/jupyter-server/jupyter_releaser/issues/612
Proposed Solution
So we should look into adopting this new trusted publisher.
What that means in practice is the following:
- Delete the
NPM_TOKENsecret from the repo - On https://www.npmjs.com, for each package, set up the trusted publisher with the following information:
- Organization or user*: jupyterlab
- Repository*: jupyterlab
- Workflow filename*: publish-release.yml
- Environment name: release
-
Remove-> it was likely already removed beforejupyterlab-release-botfrom the@jupyterlaborg on npm - Enable the strictest security option on npm: "Require two-factor authentication and disallow tokens (recommended)"
Additional context
Looking at the latest JupyterLab release, it seems like we currently publish 105 packages to npm for each release.
So that means that we will need to go to each of these packages on npm and set up the trusted publisher manually.
This will be very tedious, but at least it would only have to be done once. Unless there is a way to automate this?
Source: jupyterlab/jupyterlab