# @openreplay/tracker

> The OpenReplay tracker main package

Latest version **19.0.1** (published 2026-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @openreplay/tracker
pnpm add @openreplay/tracker
yarn add @openreplay/tracker
bun add @openreplay/tracker
```

## Health

**Score 70/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 19.0.1 |
| Published | 2026-09-29 |
| First published | 2021-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.0 |
| Dependencies | 3 |
| Unpacked size | 5.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alex Tsokurov |
| Maintainers | shekarsiri, estradino, deliriumvt, tahayk |
| Keywords | logging, replay |

## Links

- npm: https://www.npmjs.com/package/@openreplay/tracker
- npm.io page: https://npm.io/package/@openreplay/tracker

## Dependencies (3)

- [web-vitals](https://npm.io/package/web-vitals.md) ^5.3.0
- [error-stack-parser-es](https://npm.io/package/error-stack-parser-es.md) 2.0.1
- [@openreplay/network-proxy](https://npm.io/package/@openreplay/network-proxy.md) ^1.2.5

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 19.0.1 (latest) — 2026-09-29
- 20.0.0-beta.1 (beta) — 2026-09-29
- 17.2.10 (legacy) — 2026-05-13
- 3.4.0-debug.0 (debug) — 2021-09-30
- 19.0.0 — 2026-09-28
- 18.2.0 — 2026-09-22
- 18.1.6 — 2026-09-15
- 18.1.5 — 2026-09-03
- 18.1.4 — 2026-09-02
- 18.1.3 — 2026-08-12
- 19.0.0-beta.0 — 2026-08-03
- 18.1.2 — 2026-07-29
- 18.1.1 — 2026-07-27
- 18.1.0 — 2026-07-02
- 18.1.0-beta.0 — 2026-07-01
- … 349 more at https://npm.io/package/@openreplay/tracker/versions

## README

# OpenReplay Tracker

The main package of the [OpenReplay](https://openreplay.com/) tracker.

## Development & Contribution

Please use [bun](https://bun.sh/) to install and build this library. Any submitted pull request must pass **all tests** and should have positive test coverage diff %.

## Documentation

For launch options and available public methods, [refer to the documentation](https://docs.openreplay.com/en/sdk/methods)

## Installation

```bash
npm i @openreplay/tracker
```

## Usage

Initialize the package from your codebase entry point and start the tracker. You must set the `projectKey` option in the constructor. Its value can can be found in your OpenReplay dashboard under [Preferences -> Projects](https://app.openreplay.com/client/projects).

```js
import Tracker from '@openreplay/tracker'

const tracker = new Tracker({
  projectKey: YOUR_PROJECT_KEY,
})
tracker
  .start({
    userID: 'Mr.Smith',
    metadata: {
      version: '3.5.0',
      balance: '10M',
      role: 'admin',
    },
  })
  .then((startedSession) => {
    if (startedSession.success) {
      console.log(startedSession)
    }
  })
```

Then you can use OpenReplay JavaScript API anywhere in your code.

```js
tracker.setUserID('my_user_id')
tracker.setMetadata('env', 'prod')
```

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