Skip to main content
The default registry is https://registry.npmjs.org. You can configure a different default registry or use per-scope registries for private packages — in both bunfig.toml and .npmrc.

Default registry

Set a custom default registry in bunfig.toml:
Or with an environment variable:

Scoped registries

Route packages under a specific @scope to a different registry:
Use environment variable references like "$NPM_TOKEN" to avoid committing credentials to source control.

Private registries

GitHub Packages

Verdaccio (self-hosted)

Azure Artifacts

.npmrc compatibility

Bun also reads .npmrc files, so existing npm configurations work without changes.

Set the default registry

Set a scoped registry

Authentication

Supported authentication fields: _authToken, username, _password, _auth, email.
We recommend migrating .npmrc to bunfig.toml for access to Bun-specific configuration options.

Logging in

To authenticate with a registry interactively, use bunx npm login:
After logging in, check the current user: