💿 Using a Private Registry as a Proxy Cache for Bit Components

Since Bit's package registry adheres to the CommonJS specification for package managers, it can be easily configured as an NPM Remote Repository.

This setup allows you to use your internal package registry to centralize the consumption of internal packages, public npmjs.org packages, and components shared with Bit, creating a unified workflow for developers within your organization.

The overall flow of data and components will resemble this:

Data and component flow diagram

Obtaining a Token for Fetching Components:

  1. Log in as an organization administrator.
  2. Navigate to your organization settings.
  3. Open the "Settings" tab and go to the "Access Token" section.
  4. Generate a "Read Only" access token with your desired expiration date.
Access token generation

Configuring Remote Registries in Your Internal Package Registry:

Within your chosen internal package registry, configure the remote registry:

  • YOUR-ACCOUNT-NAME registry, with URL - https://node-registry.bit.cloud

Use the generated access token.

With this setup, developers in your organization using your standard package registry as their primary source will be able to install components from Bit. Your package registry will function as a proxy/cache for all component installations, eliminating the need for users to configure additional registries.

Use JFrog Artifactory

For teams using the JFrog Artifactory solution, you'll need to create a remote NPM registry and then add it to your npm virtual repository.

When configuring authentication, JFrog Artifactory doesn't offer a "Bearer Token" option. Use these values instead:

  • User Name: ___user-token
  • Password / Access Token: Your organization's access token.

The configuration should look similar to this:

JFrog Artifactory configuration

Use Sonatype Nexus

For teams using the Sonatype Nexus solution, you'll need to create a remote NPM registry.

Use the "Bearer token" authentication option for the remote NPM registry, and provide the generated token.



🦶 Next steps