In Azure
Artifact’s
instructions for
.npmrc, they say to base64 encode the password. Do not do this for bun install. Bun will automatically base64 encode the password for you if needed.Configure with bunfig.toml
To use it with
bun install, add a bunfig.toml file to your project with the following contents. Make sure to replace my-azure-artifacts-user with your Azure Artifacts username, such as jarred1234.
bunfig.toml
Then assign your Azure Personal Access Token to the
NPM_PASSWORD environment variable. Bun automatically reads .env files, so create a file called .env in your project root. There is no need to base-64 encode this token! Bun will do this for you.
.env
Configure with environment variables
To configure Azure Artifacts without
bunfig.toml, you can set the NPM_CONFIG_REGISTRY environment variable. The URL should include :username and :_password as query parameters. Replace <USERNAME> and <PASSWORD> with the apprropriate values.
terminal
Don’t base64 encode the password
In Azure Artifact’s instructions for
.npmrc, they say to base64 encode the password. Do not do this for bun install. Bun will automatically base64 encode the password for you if needed.
Tip — If it ends with
==, it probably is base64 encoded.To decode a base64-encoded password, open your browser console and run:
browser
Alternatively, use the
base64 command line tool, but doing so means it may be saved in your terminal history which is not recommended:
terminal