# @sentry/browser

> Official Sentry SDK for browsers

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

## Install

```sh
npm install @sentry/browser
pnpm add @sentry/browser
yarn add @sentry/browser
bun add @sentry/browser
```

## 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 | 10.74.0 |
| Published | 2026-09-09 |
| First published | 2017-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 6 |
| Unpacked size | 2.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8745 |
| Author | Sentry |
| Maintainers | sentry-bot |

## Links

- npm: https://www.npmjs.com/package/@sentry/browser
- Repository: https://github.com/getsentry/sentry-javascript
- Homepage: https://github.com/getsentry/sentry-javascript/tree/master/packages/browser
- Issues: https://github.com/getsentry/sentry-javascript/issues
- npm.io page: https://npm.io/package/@sentry/browser

## Dependencies (6)

- [@sentry/core](https://npm.io/package/@sentry/core.md) 10.74.0
- [@sentry/replay](https://npm.io/package/@sentry/replay.md) 10.74.0
- [@sentry/feedback](https://npm.io/package/@sentry/feedback.md) 10.74.0
- [@sentry/conventions](https://npm.io/package/@sentry/conventions.md) ^0.16.0
- [@sentry/browser-utils](https://npm.io/package/@sentry/browser-utils.md) 10.74.0
- [@sentry/replay-canvas](https://npm.io/package/@sentry/replay-canvas.md) 10.74.0

## Recent versions

- 10.74.0 (latest) — 2026-09-09
- 11.0.0-beta.2 (next) — 2026-09-09
- 8.55.2 (v8) — 2026-04-28
- 9.47.1 (v9) — 2025-11-17
- 7.120.4 (v7) — 2025-07-29
- 11.0.0-beta.1 — 2026-09-03
- 11.0.0-beta.0 — 2026-09-02
- 10.73.0 — 2026-08-31
- 11.0.0-alpha.2 — 2026-08-28
- 10.72.0 — 2026-08-28
- 10.71.0 — 2026-08-24
- 11.0.0-alpha.1 — 2026-08-12
- 10.70.0 — 2026-08-10
- 11.0.0-alpha.0 — 2026-08-07
- 10.69.0 — 2026-07-29
- … 724 more at https://npm.io/package/@sentry/browser/versions

## README

<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Official Sentry SDK for Browsers

[![Sauce Test Status](https://saucelabs.com/buildstatus/sentryio)](https://saucelabs.com/u/sentryio)
[![npm version](https://img.shields.io/npm/v/@sentry/browser.svg)](https://www.npmjs.com/package/@sentry/browser)
[![npm dm](https://img.shields.io/npm/dm/@sentry/browser.svg)](https://www.npmjs.com/package/@sentry/browser)
[![npm dt](https://img.shields.io/npm/dt/@sentry/browser.svg)](https://www.npmjs.com/package/@sentry/browser)

## Links

- [Official SDK Docs](https://docs.sentry.io/quickstart/)

## Usage

To use this SDK, call `Sentry.init(options)` as early as possible after loading the page. This will initialize the SDK
and hook into the environment. Note that you can turn off almost all side effects using the respective options.

```javascript
import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: '__DSN__',
  // ...
});
```

To set context information or send manual events, use the exported functions of `@sentry/browser`. Note that these
functions will not perform any action before you have called `Sentry.init()`:

```javascript
import * as Sentry from '@sentry/browser';

// Set user information, as well as tags and further extras
Sentry.setExtra('battery', 0.7);
Sentry.setTag('user_mode', 'admin');
Sentry.setUser({ id: '4711' });

// Add a breadcrumb for future events
Sentry.addBreadcrumb({
  message: 'My Breadcrumb',
  // ...
});

// Capture exceptions, messages or manual events
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
  message: 'Manual',
  stacktrace: [
    // ...
  ],
});
```

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