PackagePass

Getting started

Publish a private package, grant access, and install it from PackagePass.

This guide uses the CLI because it gives the quickest path from a local package to an npm-compatible private install. The same workflow is available through the TypeScript SDK and REST API.

Before you start

Dashboard access

Sign in to PackagePass and select the organization that owns the package scope.

A scoped package

PackagePass accepts scoped package names such as @acme/payments.

A package manager

Install configuration can be generated for npm, pnpm, Yarn, and Bun.

Base URLs

Control API

https://api.preview.packagepass.dev/v1 handles packages, grants, tokens, policy, and audit events.

Registry

https://registry.preview.packagepass.dev/npm/ is the npm-compatible registry URL used by package managers.

Quickstart

Run the first publish flow

  1. 1

    Install the CLI

    install
    npm install -g @packagepass/cli
    
    packagepass --help
  2. 2

    Authenticate the CLI

    interactive login
    packagepass login
    
    packagepass login \
      --tenant acme \
      --api-url https://api.preview.packagepass.dev/v1 \
      --registry-url https://registry.preview.packagepass.dev/npm/
    
    packagepass whoami
  3. 3

    Create package metadata

    package
    packagepass package create @acme/payments \
      --description "Customer payments SDK"
    
    packagepass package get @acme/payments
  4. 4

    Publish a release

    publish
    cd packages/payments
    npm run build
    
    packagepass publish . --tag latest
    
    packagepass version list @acme/payments
    packagepass dist-tag list @acme/payments
  5. 5

    Grant install access

    grant
    packagepass grant add @acme/payments \
      --subject customer:globex \
      --action install
    
    packagepass policy explain @acme/payments \
      --subject customer:globex \
      --action install
  6. 6

    Create an install token

    token
    packagepass token create install \
      --package @acme/payments \
      --subject customer:globex \
      --ttl 30d
  7. 7

    Configure the package manager

    setup
    export PACKAGEPASS_TOKEN=<install-token>
    
    packagepass setup @acme --manager npm --write
    
    npm install @acme/payments
  8. 8

    Check the environment

    doctor
    packagepass doctor @acme/payments

Generate install config

Use the preview below to switch package managers. The CLI writes this content with packagepass setup @scope --manager <manager> --write.

.npmrc
@acme:registry=https://registry.preview.packagepass.dev/npm/
//registry.preview.packagepass.dev/npm/:_authToken=${PACKAGEPASS_TOKEN}

npm install @acme/payments

Automation login

Use an API key for noninteractive environments such as CI jobs, scripts, and headless release workers.

api-key login
packagepass login \
  --api-key $PACKAGEPASS_API_KEY \
  --tenant acme \
  --api-url https://api.preview.packagepass.dev/v1 \
  --registry-url https://registry.preview.packagepass.dev/npm/