Depot Packages

Publish your first package

This quickstart shows you how to create a Private npm repository, publish a package to it, and install that package in another project. For other package managers, see the package manager guides.

Before you begin

You need a Depot account, the Depot CLI, and npm. You also need owner or administrator access to a Depot organization to create a repository.

Create a Private repository

  1. Open your organization's Packages and select Create repository.
  2. Under Format, select npm. Under Kind, select Private.
  3. Enter internal as the name, then select Create repository.
  4. Open Setup and copy the organization ID from the repository endpoint.

Configure npm

  1. Sign in to Depot:

    depot login
  2. Route a package scope to the repository:

    depot packages configure npm --org <org-id> --repository internal --scope @acme

    Replace <org-id> with the copied organization ID and @acme with a scope for your packages. npm sends packages in that scope to internal and continues to get other packages from the npm registry. The command saves the registry and your token in your user ~/.npmrc.

Publish a package

  1. Create a package in the @acme scope:

    mkdir hello && cd hello
    npm init -y --scope=@acme
  2. Publish the package:

    npm publish
  3. Open internal in Packages and confirm that @acme/hello version 1.0.0 appears.

Install the package

In another project, install the package:

npm install @acme/hello

npm downloads @acme/hello from internal.

Next steps