---
title: "@vltpkg/user-agent: Reference — vlt docs"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/api-reference/user-agent/reference"
image: "https://docs.vlt.io/og/client/api-reference/user-agent/reference"
lang: "en"
---

# Reference

## Variables

### userAgent

```ts
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

```ts
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](https://docs.vlt.io/client/api-reference/user-agent/reference.md#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.
