Depot Packages

Install your first package

Install a package through Depot without creating an organization token. This walkthrough uses npm and the built-in npmjs cache. Other clients follow the same flow in the ecosystem guides.

Before you begin

You need a Depot account, membership in a Depot organization, the Depot CLI, and npm. Reader access is sufficient to install packages.

Install through Depot

  1. Sign in to Depot:

    depot login
  2. Open your organization's Packages, select Cache repositories, and open npmjs. Copy the organization ID from the repository endpoint on Setup.

  3. Configure npm to use the cache:

    depot packages configure npm --org <org-id> --repository npmjs

    Replace <org-id> with the copied organization ID. The command sets the registry and saves your token in your user ~/.npmrc.

  4. Install a dependency:

    npm install lodash

    npm installs lodash through Depot, and Depot caches the upstream download. You can find the package in the npmjs repository in Packages.

Rerun depot packages configure when your login token changes. To keep the token out of ~/.npmrc, or to configure CI, follow the npm guide instead.

Publish a private package

Publishing requires a Private repository or a Virtual repository with publishing enabled. Ask an owner or administrator to create a Private npm repository named internal in Packages.

  1. In a package project with a valid name and version in package.json, configure the publish destination:

    depot packages configure npm --org <org-id> --repository internal --auth-only
    npm pkg set publishConfig.registry=https://packages.depot.dev/<org-id>/npm/internal/

    --auth-only saves a credential for internal and keeps npmjs as your install registry.

    The package must not have "private": true. Choose a package name and version your team hasn't published.

  2. Publish the package:

    npm publish
  3. Open internal in Packages and confirm that the version appears.

The Private repository contains your packages. To install those packages alongside npm dependencies through one URL, create a Virtual repository.