Skip to content
Source
Sign inSign up

Install a package preview

CI / Results on pull requests

Install a package preview

A maintainer fixed your bug in a pull request, and asks you to try the fix before the release. The pull request has a preview of the packages, so you can install the fix with one line.

3 min read

1. Copy the install command

  1. Open the pull request. The Package previews card is at the top of the Conversation tab, under the description.
  2. Pick your package manager in the switch of the card: npm, pnpm, yarn or bun.
  3. Click the copy button on the row of the package that you need. To install every package of the list, click Copy all.
The Package previews card of a TanStack/ai pull request: commit fac7c8f, 80 files, the pnpm switch picked, a filter field, Copy all, and six package rows, each with a version, a copy button and a download button. Show all 80 is at the bottom
  • The card shows the newest preview of the pull request, with its short commit, for example 4e5f6a7. When a new preview is ready, the card shows it, with no reload.
  • If the card says that the preview is from an older commit, the newest push has no preview yet.
  • With more than 6 packages, type a part of the name in the filter field to find yours.
  • A Python row copies pip install <url>. A row of another file copies its URL, and its name is a download link.

2. Install it

If the card says that the repository is private, first give your tool a token: see Install from a private repository.

Paste the command in your project and run it. The card copies one of these commands, with the URL of the file in place of <url>. For uv, copy the pip command and change its start:

ToolCommand
npmnpm i <url>
pnpmpnpm add --config.block-exotic-subdeps=false <url>
yarnyarn add <url>
bunbun add <url>
pippip install <url>
uvuv pip install <url>
  • Install only the package that you need. When it depends on another package of the same preview, that dependency comes from the preview too.
  • The pnpm command turns off block-exotic-subdeps for this install only. pnpm 11 has it on, and then it refuses a package that takes another package of the preview by URL.

Warning

Do not commit a preview URL in your package.json or your lockfile. The forge deletes the preview about 3 days after the pull request closes, and then the URL answers 404 Not Found.

3. Try the fix

Run your app or your tests with the preview. Then comment on the pull request to say if the fix works.

Done

You installed the fix from the pull request, before any release.

Install from a private repository

The card says when the repository is private. Then you need a token that can read the repository.

  1. Make a token with Read access to the repository. Make an access token shows how.
  2. Give the token to your tool, as below.
  3. Run the install command of step 2.

For npm and pnpm, add this line to your .npmrc, with the host of the forge. The card shows the line with the correct host, and a button that copies it:

//forge.example/:_authToken=${TSS_TOKEN}

Then set TSS_TOKEN to your token in your shell.

For pip and uv, put the token in the URL:

pip install https://token:<your token>@forge.example/@acme/lib/assets/package-previews/12/4e5f6a7/acme_core-1.2.0-py3-none-any.whl

Or put the token in your .netrc, and use the command from the card as it is:

machine forge.example
login token
password <your token>

Warning

Do not commit a .npmrc or a .netrc that has your token in it.