The current documentation for the tokenHelper setting describes it as such:
A token helper is an executable which outputs an auth token. This can be used in situations where the authToken is not a constant value but is something that refreshes regularly, where a script or other tool can use an existing refresh token to obtain a new access token.
This is not a completely accurate description, as pnpm expects a tokenHelper script to output the full value of the Authorization header, ie. Bearer MY_TOKEN, rather than just a token by itself.
This is distinct from the _authToken setting, which only expects the value of the token itself (MY_TOKEN from the previous example).
Given that the two settings are documented using similar language, it's probably worth calling out the slightly-different behaviors.
Notably, if you fall into this trap (as I did), it's rather confusing/difficult to debug – PNPM (quite sensibly) scrubs Authorization header values from logging/errors.
The current documentation for the
tokenHelpersetting describes it as such:This is not a completely accurate description, as pnpm expects a
tokenHelperscript to output the full value of theAuthorizationheader, ie.Bearer MY_TOKEN, rather than just a token by itself.This is distinct from the
_authTokensetting, which only expects the value of the token itself (MY_TOKENfrom the previous example).Given that the two settings are documented using similar language, it's probably worth calling out the slightly-different behaviors.
Notably, if you fall into this trap (as I did), it's rather confusing/difficult to debug – PNPM (quite sensibly) scrubs Authorization header values from logging/errors.