vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • Reference
  • Variables
  • userAgent
  • userAgentHeaders
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/user-agent
  6. /
  7. Reference

Reference

Variables

userAgent

TypeScript
const userAgent: string;

Defined in: index.ts:49

The User-Agent header sent with every request vlt makes, and the value of npm_config_user_agent in lifecycle script environments.

Looks like vlt/1.2.3 Node.js/22.22.0, with the trailing portion coming from navigator.userAgent when the runtime provides one.


userAgentHeaders

TypeScript
const userAgentHeaders: Readonly<Record<string, string>>;

Defined in: index.ts:60

Headers to spread into the headers of a fetch() call so that the request carries userAgent.

Empty in browsers: the browser sets its own User-Agent and does not let scripts override it, and since User-Agent is not a CORS-safelisted request header, setting it would force a preflight on cross-origin registry requests that not every registry accepts.


Previous@vltpkg/user-agentNext@vltpkg/vlt-json

On this page

  • Variables
  • userAgent
  • userAgentHeaders

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