Skip to content
API Referenceuser-agentReference

@vltpkg/user-agent

Variables

userAgent

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

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.