vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Why vlt
  • Use cases
  • npm interoperability
  • Reference

Registry
  • Quick Start
  • Using Packages
  • Membership & Access
  • Dashboard
  • Authentication & Tokens

Client
  • Getting Started
  • Configuring
  • Authentication
  • Registries
  • Security
  • Workspaces
  • Affected
  • Catalogs
  • Peer Dependencies
  • Graph Modifiers
  • Global Installs
  • Log in from the CLI
  • Personal and service tokens
  • Privileges and expiry
  • Managing tokens
  • Using tokens in CI
  • Removing credentials
  1. Registry
  2. /
  3. Authentication & Tokens

Authentication & Tokens

Every request to the vlt registry is authenticated with a bearer token, apart from the endpoints used by the login flow itself. Tokens belong to an account — one token works for both of the account's registries (main and npm).

Log in from the CLI

The registry supports the npm web login flow. Point your client at your registry and log in:

Terminal
$ vlt login --registry=https://registry.vlt.io/acme/main/

Your browser opens vlt.io to confirm the login, and the client stores the resulting token in the vlt keychain. npm works the same way:

Terminal
$ npm login --auth-type=web --registry=https://registry.vlt.io/acme/main/

See Authentication for everything the vlt client supports around credential storage and identities.

Personal and service tokens

There are two kinds of tokens:

  • Personal tokens are bound to your user. Writes made with a personal token are subject to the account's two-factor (OTP) requirement. Logging in from the CLI mints a personal token scoped to package:read and package:write.
  • Service tokens belong to the account rather than a person. They are meant for CI and automation, and they are not subject to OTP prompts. Creating service tokens requires an owner or admin role.

Tokens start with the vlt_1_ prefix. The registry stores only a hash of each token, so the full value is shown once at creation — copy it then.

Privileges and expiry

Every token carries a set of privileges, such as package:read, package:write, token:read, or member:write. A request succeeds only if both the token and the requesting user's account role grant the privilege, so a read-only token stays read-only no matter who uses it, and a token can never grant more than its creator's own role allows.

For example, a CI token that only installs packages needs just package:read; a publish token needs package:write as well.

Tokens can optionally be given an expiration date, after which they stop working. Expired and revoked tokens are rejected on every request.

Managing tokens

Create, inspect, and revoke tokens from your account's token settings in the dashboard. Members can create and revoke their own personal tokens; owners and admins can also manage service tokens.

note

The dashboard is the easiest place to manage tokens, but the npm token subcommands (npm token list, npm token create) also work against your registry. pnpm token does not — pnpm reports Not implemented in pnpm. Use the npm CLI directly.

Using tokens in CI

Provide a token through the environment rather than a config file. The portable form is VLT_TOKEN alongside VLT_REGISTRY:

Terminal
VLT_REGISTRY=https://registry.vlt.io/acme/main/ \
VLT_TOKEN="<service token>" vlt install

To authenticate more than one registry, set a per-registry VLT_TOKEN_* variable for each configured registry, named after its URL with the trailing / dropped and each run of non-alphanumeric characters replaced by _:

Terminal
VLT_TOKEN_https_registry_vlt_io_acme_npm="<service token>" \
VLT_TOKEN_https_registry_vlt_io_acme_main="<service token>" \
vlt install

This applies to registries and scoped-registries alike.

See Authentication — CI for details, and CI & automation for the publish workflow.

With npm, use the standard .npmrc auth entry, ideally referencing an environment variable:

.npmrc
@acme:registry=https://registry.vlt.io/acme/main/
//registry.vlt.io/acme/main/:_authToken=${NPM_TOKEN}

That form works for npm — an unset variable is sent as the literal string, so a missing secret fails like a bad token. pnpm ignores ${...} in a project .npmrc; see pnpm in CI. Never commit a literal token, or have CI write one into the project .npmrc. For which tool reads what, Vercel and agent sandboxes, see CI & automation.

Removing credentials

  • vlt logout --registry=... removes the token from your keychain, under every registry key holding it (e.g. both npm and main). Revoke the token itself in the dashboard.
  • vlt token rm removes a token from your local keychain only.
  • Revoking a token in the dashboard invalidates it everywhere, immediately.

PreviousDashboardNextOverview

On this page

  • Log in from the CLI
  • Personal and service tokens
  • Privileges and expiry
  • Managing tokens
  • Using tokens in CI
  • Removing credentials
Edit this page

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now