Skip to main content
Version: 1.0.0

NPM Private Registry

This guide covers two types of NPM Private Registries:

  1. NPM Private Registry looks like

  2. GitHub NPM Registry looks like


Note: This guide does not cover how to publish packages to the NPM registry. This guide covers how to import and use packages published to NPM Private Registry or GitHub NPM Registry using npm.

1. Create an Private Access Token

For packages on npm.js

To access private packages on the NPM Private Registry, you'll first need to create an authentication token.

npm token create --read-only

See NPM's docs here for detailed instructions.

For packages on

Generate a Personal Access Token (PAT) with the read:packages scope. You can find this by navigating to Settings -> Applications -> Personal Access Token.

2. Add the token to Zeet

Once you have created your token, add it as an Environment Variable to your Project, which you can find in the General tab in your Project settings.

3. Configure your repo to use the Private NPM registry

Now that you have the right access to your registry, the next step is to configure your repo to use the private NPM registry. You can look at this GitHub repo for reference to see what the configuration will look like.

For packages on npm.js

Now, we create a configuration file for npm in the root directory called .npmrc

For packages on, you need to specify the authentication method for the private NPM registry. ${NPM_TOKEN} will be loaded from the environment variable set in Step 2 at build time; so you don't need to commit any secrets along with your source code!

npm config set registry
echo "//${NPM_TOKEN}" >> ~/.npmrc

Note that you have to replace with the URL of your private registry.

For packages on

Add the GitHub Package Registry as an additionally registry in your .npmrc file along with your GitHub PAT.

echo "registry=" >> ~/.npmrc
echo "//{GITHUB_TOKEN}" >> ~/.npmrc

4. Install package

Now that everything is configured, you can go ahead and install a package using npm or yarn like this:

For packages on

npm install my-private-registry


yarn add my-private-registry

For packages on

npm install @owner/my-private-repo


yarn add @owner/my-private-repo

5. Commit and deploy!

Once you have added your dependencies to package.json and the auth config in .npmrc, commit and push your code to GitHub. Zeet should automatically rebuild and redeploy your Project and inject the Environment variable you set to download your private NPM dependencies!