PackagePass

Guides

Recipes for the workflows teams repeat every week.

Use these guides when you already understand the basics and need a concrete workflow for releases, previews, customer installs, CI, or policy debugging.

Release

Publish a production release

  1. 1

    Build the package

    build
    cd packages/payments
    npm ci
    npm run build
    npm test
  2. 2

    Run a dry publish

    dry run
    packagepass publish . --tag next --dry-run
  3. 3

    Publish and promote

    publish
    packagepass publish . --tag latest
    
    packagepass dist-tag list @acme/payments
  4. 4

    Audit the release

    audit
    packagepass audit events \
      --package @acme/payments \
      --type package.published \
      --limit 20

Previews

Ship a pull-request package

publish preview
packagepass preview publish ./packages/auth \
  --channel pr-482

npm install @acme/auth@preview-pr-482

When to use previews

Publish previews for customer SDK review apps, integration tests, generated-code diffs, or any workflow where consumers need a package before it becomes a stable release.

Customers

Give one customer access to one package

  1. 1

    Create or identify the subject

    subject
    # In the CLI, subjects can be referenced directly.
    # In the SDK/API, you can create customer records first.
    customer:globex
  2. 2

    Grant only install access

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

    Mint a short-lived install token

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

    Generate package manager config

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

Configure npm, pnpm, Yarn, and Bun

.npmrc
@acme:registry=https://registry.preview.packagepass.dev/npm/
//registry.preview.packagepass.dev/npm/:_authToken=${PACKAGEPASS_TOKEN}
bunfig.toml
[install.scopes]
"@acme" = { url = "https://registry.preview.packagepass.dev/npm/", token = "$PACKAGEPASS_TOKEN" }

Do not commit tokens

Commit the registry mapping if your repo needs it, but keep PACKAGEPASS_TOKEN in the environment or secret manager.

CI

Exchange a CI identity token

github actions
packagepass ci exchange \
  --provider github \
  --id-token "$ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
  --package @acme/payments

Use case

CI exchange lets your pipeline authenticate as a workflow identity instead of storing a long-lived publishing token.

Troubleshooting

Debug an install failure

  1. 1

    Check local configuration

    doctor
    packagepass doctor @acme/payments
    
    PACKAGEPASS_TOKEN=<install-token> \
      packagepass doctor @acme/payments
  2. 2

    Verify the subject has install access

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

    Inspect audit events

    audit
    packagepass audit events \
      --package @acme/payments \
      --type policy.denied \
      --limit 50
  4. 4

    Regenerate install config

    setup
    packagepass setup @acme --manager npm --write