#17993·jupyterlab

Use npm trusted publishers

Author: jtpioCreated Oct 14, 2025Updated Oct 1, 2026
Labelsmaintenance

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_TOKEN secret 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 jupyterlab-release-bot from the @jupyterlab org on npm -> it was likely already removed before
  • Enable the strictest security option on npm: "Require two-factor authentication and disallow tokens (recommended)"
Image

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?