# ua-string

> Get the user agent of a recent Chrome version to pretend to be a browser in network requests

Latest version **4.2.0** (published 2026-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install ua-string
pnpm add ua-string
yarn add ua-string
bun add ua-string
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2026-03-04 |
| First published | 2016-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | user-agent, user, agent, navigator, browser, chrome, network, request, fetch, got, http, header, string, recent, pretend, imitate, mimic |

## Links

- npm: https://www.npmjs.com/package/ua-string
- Repository: https://github.com/sindresorhus/ua-string
- Homepage: https://github.com/sindresorhus/ua-string#readme
- Issues: https://github.com/sindresorhus/ua-string/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/ua-string

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 4.2.0 (latest) — 2026-03-04
- 4.1.0 — 2023-11-04
- 4.0.0 — 2021-04-07
- 3.1.0 — 2020-04-14
- 3.0.0 — 2019-04-29
- 2.1.0 — 2019-01-23
- 2.0.0 — 2018-11-08
- 1.2.0 — 2018-07-28
- 1.1.0 — 2017-03-25
- 1.0.0 — 2016-11-04

## README

# ua-string

> Get the [user agent](https://en.wikipedia.org/wiki/User_agent) of a recent Chrome version to pretend to be a browser in network requests

Some sites and services block non-browser requests or respond differently.

*I will update this module once in a while with the latest user agent.*

## Install

```sh
npm install ua-string
```

## Usage

```js
import got from 'got';
import userAgentString from 'ua-string';

await got('https://sindresorhus.com', {
	headers: {
		'user-agent': userAgentString
	}
});
```

---
_Source: https://npm.io/package/ua-string · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
