vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Overview
  • Usage
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/keychain

@vltpkg/keychain

@vltpkg/keychain

The filesystem keychain for @vltpkg/registry-client

Usage

Overview

This is a tool to store and retrieve private keys for use in the @vltpkg/registry-client.

Usage

JavaScript
import { Keychain } from '@vltpkg/keychain'

// define a keychain with a given application scope
const kc = new Keychain('vlt/auth')

// fetch the auth for a given origin, for example.
// will load file on demand when first get() called.
const auth = await kc.get('https://registry.npmjs.org')

// set a value like this
kc.set('https://some-registry.com', 'Bearer newtoken')

// will attempt to save on process end if there are pending
// writes, but only if the file has not been modified since.
// you can also trigger a write explicitly.
await kc.save()

PreviousReferenceNextReference

On this page

  • Overview
  • Usage

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