Authentication and CI
Use depot login and depot packages configure for local development.
In CI, choose one of these authentication methods:
- Use an existing Depot CI job token or Depot GitHub Actions runner token when available.
- Publish with trusted publishing.
- Supply a credential from your CI secret store.
Package managers must authenticate to read metadata, download packages, and publish. A repository that caches a public upstream still requires Depot authentication. Service discovery and signed download URLs don't require a second login.
Set up local development
-
Install the Depot CLI and sign in:
depot login -
Configure your package manager for a repository. This example routes npm through the built-in
npmjscache:depot packages configure npm --org <org-id> --repository npmjs -
Run the package manager normally.
To configure your package manager manually, follow your client guide. The guides use native client configuration and environment variables. No Depot package-manager adapter is required.
Configuration containing only repository URLs and environment-variable references can be shared. Don't commit credential files or URLs containing tokens. Environment variables are available to child processes; run unset DEPOT_TOKEN when finished.
Configure a package manager with the Depot CLI
depot packages configure <client> writes the routing and credential settings for one client and repository. It supports npm, pnpm, yarn (Yarn Classic only), bun, cargo, bundler, gem, helm, mamba, micromamba, pixi, apt, dnf, yum, zypper, and apk.
depot packages configure <client> --org <org-id> --repository <repository>--org defaults to your current organization. The command uses DEPOT_TOKEN when it's set. Otherwise, it uses the token from depot login.
pnpm and Cargo get the current token from the Depot CLI each time they need it, so you don't have to rerun the command when your token changes. Cargo 1.79 or later is required. To save a token in their configuration instead, add --auth store.
All other clients save a copy of the token in their own configuration files. Only the file owner can read those files. Rerun the command when your token changes.
The command changes only Depot entries and keeps your other settings. If an environment variable or project configuration file would override the new settings, the command stops with an error. Remove the conflicting setting, then rerun the command. The output lists every file the command changed.
Route the default public registry through Depot
--replace-upstream routes the client's default public source through the repository. It applies to Cargo (crates.io), Bundler and gem (RubyGems.org), and mamba, micromamba, and Pixi (conda-forge and defaults channels). It's on by default when the repository is that registry's built-in cache, such as crates-io or rubygems. Use it only with a Cache or Virtual repository that includes the upstream registry.
To undo an earlier replacement, rerun the command with --replace-upstream=false.
Configure system package managers
apt, dnf, yum, zypper, and apk are supported on Linux only. The command writes files under /etc, or /root/.netrc for apk. Run it as root, or as a user who can use sudo or doas. It passes file contents to sudo or doas on standard input, so the token doesn't appear in the process list. It uses your Depot token, not the root user's login.
Each client guide lists the options for that client.
Understand permissions
The following permissions apply across repositories in the token's organization:
| Credential | Read packages | Publish packages | Configure repositories and delete packages |
|---|---|---|---|
| Personal login, owner or administrator | Yes | Yes | Yes |
| Personal login, member | Yes | Yes | No |
| Personal login, reader | Yes | No | No |
| Depot runner token | Yes | Yes | No |
| Depot CI job token | Yes | Yes | No |
| Organization token | Yes | Yes | Yes |
| Trusted publishing token | Where a trust policy matches | Where a trust policy matches | No |
A repository must also support publishing. Cache repositories are read-only. For a Virtual repository, select a Private source in Publish packages to under Settings, Sources and publishing.
An organization token grants administrative access to all package repositories in that organization. Don’t use an organization token as the default credential for installing packages. Using a credential helper doesn’t reduce the token’s permissions.
Use Depot CI and runners
Depot CI supplies a DEPOT_TOKEN to most jobs. Keep that credential when configuring Packages; don't replace it with a personal or organization token. On Depot runners, use the existing runner credential when it's available to the process. Package-manager routing still needs configuration.
Follow the routing and authentication configuration in your client guide, then run its install or publish command. Use the injected DEPOT_TOKEN directly. If a client requires a credential file, create it inside the job with restricted permissions and exclude it from caches and artifacts.
A Depot CI job token can read and publish packages. Depot doesn't supply DEPOT_TOKEN to these jobs:
- Jobs from untrusted pull requests, such as pull requests from forks.
- Jobs that run a reusable workflow from another repository, including a repository in the same organization.
Depot decides this for each job. You can't change it in your organization or repository settings. On Depot GitHub Actions runners, the runner’s Depot credential also allows package publishing. Don’t expose that credential to untrusted code.
Use external CI
Store a Depot credential with access to the target organization in your CI provider’s secret store. Expose the credential as DEPOT_TOKEN only to steps that need Depot Packages. Then apply the native configuration in your client guide and run the install command.
Choose the credential's identity and permissions deliberately. A user token follows that user's organization membership. An organization token has administrative permissions. A GitHub GITHUB_TOKEN is not a Depot package credential. Avoid exposing publish credentials to untrusted pull request code.
For a publish step, use a Private repository or a Virtual repository with publishing enabled, and run the publish command from your ecosystem guide.
Publish without a stored token
To publish from GitHub Actions, GitLab CI/CD, or another CI system that issues OpenID Connect (OIDC) ID tokens, add a trust policy to the Private repository.
The job exchanges its ID token for a Depot token that expires after 15 minutes. You don’t need to store a publish credential in CI.
The token can publish only to Private repositories whose trust policies match the ID token. It doesn’t work through a Virtual repository. See trusted publishing.
Use environment variables
When a tool supports environment-based credentials, you can obtain your stored personal token without copying it from the dashboard:
export DEPOT_TOKEN="$(depot login token)"This exports a token to your shell and child processes. It doesn't configure a package manager. Follow the environment-variable alternative in its guide, then run unset DEPOT_TOKEN when finished. In CI, preserve the injected credential instead of replacing it with a local login. Check client credential precedence and remove stale saved entries when switching methods.
APT, RPM clients, apk, mamba, and Pixi can require credentials in local files. Their guides identify those files and explain when to refresh them.