# @snowplow/browser-tracker-core

> Core functionality for Snowplow Browser trackers

Latest version **4.10.2** (published 2026-09-09) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @snowplow/browser-tracker-core
pnpm add @snowplow/browser-tracker-core
yarn add @snowplow/browser-tracker-core
bun add @snowplow/browser-tracker-core
```

## 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 | 4.10.2 |
| Published | 2026-09-09 |
| First published | 2021-03-08 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 590 |
| Author | Paul Boocock |
| Maintainers | cksnp, snowplow-analytics, cogsp |

## Links

- npm: https://www.npmjs.com/package/@snowplow/browser-tracker-core
- Repository: https://github.com/snowplow/snowplow-javascript-tracker
- Homepage: http://bit.ly/sp-js
- Issues: https://github.com/snowplow/snowplow-javascript-tracker/issues
- npm.io page: https://npm.io/package/@snowplow/browser-tracker-core

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) ^11.1.1
- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [@snowplow/tracker-core](https://npm.io/package/@snowplow/tracker-core.md) 4.10.2

## Recent versions

- 4.10.2 (latest) — 2026-09-09
- 4.1.1-dev.2 (react-native) — 2025-01-02
- 4.0.2-dev.1 (create_react_native_tracker) — 2024-11-07
- 4.0.0-beta.4 (next) — 2024-10-22
- 3.13.2-dev.0 (1185-id-service-option) — 2023-07-04
- 3.13.1-dev.0 (add-tracking-scenario-option-to-core) — 2023-06-22
- 4.10.1 — 2026-08-19
- 4.10.0 — 2026-07-27
- 4.9.0 — 2026-07-21
- 4.8.4 — 2026-07-02
- 4.8.3 — 2026-06-30
- 4.8.2 — 2026-06-17
- 4.8.1 — 2026-05-13
- 4.8.0 — 2026-04-28
- 4.7.0 — 2026-04-01
- … 90 more at https://npm.io/package/@snowplow/browser-tracker-core/versions

## README

# Snowplow Browser Tracker Core

[![npm version][npm-image]][npm-url]
[![License][license-image]](LICENSE)

Browser Core module to be used by Snowplow Browser based trackers.

It should rarely be used alone, you probably want `@snowplow/browser-tracker`.

## Maintainer quick start

Part of the Snowplow JavaScript Tracker monorepo.  
Build with [Node.js](https://nodejs.org/en/) (18 - 20) and [Rush](https://rushjs.io/).

### Setup repository

```bash
npm install -g @microsoft/rush 
git clone https://github.com/snowplow/snowplow-javascript-tracker.git
rush update
```

### Building Browser Tracker Core

```bash
cd libraries/browser-tracker-core
rushx build
```

### Running tests

```bash
rushx test
```

## Package Installation

With npm:

```bash
npm install @snowplow/browser-tracker-core
```

## Usage

```js
import { addTracker, createSharedState, getTracker } from '@snowplow/browser-tracker-core';

const sharedState = createSharedState();
const tracker = addTracker('snowplow_sp1', 'sp1', 'js-3.0.0', '{{collector}}', sharedState, {}); // Also stores reference at module level
const sameTracker = getTracker('snowplow_sp1');
```

### Example

```js
const domainUserId = tracker.getDomainUserId();
```

## Other features

This package contains a number of helper functions for tracking events in the browser as well as the core functionality of the Snowplow JavaScript Tracker.

## Copyright and license

Licensed and distributed under the [BSD 3-Clause License](LICENSE) ([An OSI Approved License][osi]).

Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang.

All rights reserved.

[npm-url]: https://www.npmjs.com/package/@snowplow/tracker-core
[npm-image]: https://img.shields.io/npm/v/@snowplow/tracker-core
[docs]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/
[osi]: https://opensource.org/licenses/BSD-3-Clause
[license-image]: https://img.shields.io/npm/l/@snowplow/browser-tracker-core

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