# universal-user-agent

> Get a user agent string across all JavaScript Runtime Environments

Latest version **7.0.3** (published 2025-05-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install universal-user-agent
pnpm add universal-user-agent
yarn add universal-user-agent
bun add universal-user-agent
```

## Health

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

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

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 7.0.3 |
| Published | 2025-05-12 |
| First published | 2018-09-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 23 |
| Author | Gregor Martynus |
| Maintainers | gr2m |

## Links

- npm: https://www.npmjs.com/package/universal-user-agent
- Repository: https://github.com/gr2m/universal-user-agent
- Homepage: https://github.com/gr2m/universal-user-agent#readme
- Issues: https://github.com/gr2m/universal-user-agent/issues
- npm.io page: https://npm.io/package/universal-user-agent

## Recent versions

- 7.0.3 (latest) — 2025-05-12
- 6.0.1 (release-6.x) — 2023-11-04
- 7.0.2 — 2023-09-18
- 7.0.1 — 2022-09-21
- 7.0.0 — 2021-09-16
- 6.0.0 — 2020-07-16
- 5.0.0 — 2020-02-21
- 4.0.1 — 2020-02-21
- 4.0.0 — 2019-09-03
- 3.0.0 — 2019-07-12
- 2.1.0 — 2019-05-08
- 2.0.3 — 2019-01-10
- 2.0.2 — 2018-11-20
- 2.0.1 — 2018-09-19
- 2.0.0 — 2018-09-19
- … 1 more at https://npm.io/package/universal-user-agent/versions

## README

# universal-user-agent

> Get a user agent string across all JavaScript Runtime Environments

[![@latest](https://img.shields.io/npm/v/universal-user-agent.svg)](https://www.npmjs.com/package/universal-user-agent)
[![Build Status](https://github.com/gr2m/universal-user-agent/workflows/Test/badge.svg)](https://github.com/gr2m/universal-user-agent/actions/workflows/test.yml?query=workflow%3ATest)

```js
import { getUserAgent } from "universal-user-agent";

const userAgent = getUserAgent();
// userAgent will look like this
// in browser: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0"
// in node: Node.js/v8.9.4 (macOS High Sierra; x64)
```

## License

[ISC](LICENSE.md)

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