# react-sentry-error-boundary

> A React error boundary component with integrated Sentry error reporting using Raven JS

Latest version **1.2.1** (published 2018-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-sentry-error-boundary
pnpm add react-sentry-error-boundary
yarn add react-sentry-error-boundary
bun add react-sentry-error-boundary
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-07-03 |
| First published | 2018-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Sebastian Moderski |
| Maintainers | sebastianmoderski |
| Keywords | react, reactjs, raven, ravenjs, sentry, getsentry |

## Links

- npm: https://www.npmjs.com/package/react-sentry-error-boundary
- Repository: https://github.com/sebastianmoderski/react-sentry-error-boundary
- Homepage: https://github.com/sebastianmoderski/react-sentry-error-boundary#readme
- Issues: https://github.com/sebastianmoderski/react-sentry-error-boundary/issues
- npm.io page: https://npm.io/package/react-sentry-error-boundary

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-07-03
- 1.2.0 — 2018-07-03
- 1.1.0 — 2018-07-02
- 1.0.0 — 2018-07-02
- 0.0.11 — 2018-07-02
- 0.0.10 — 2018-07-02
- 0.0.9 — 2018-07-02
- 0.0.8 — 2018-07-02
- 0.0.7 — 2018-07-02
- 0.0.6 — 2018-07-02
- 0.0.5 — 2018-07-02
- 0.0.4 — 2018-07-02
- 0.0.3 — 2018-07-02
- 0.0.2 — 2018-07-02
- 0.0.1 — 2018-07-02

## README

# react-sentry-error-boundary
A React error boundary component with integrated Sentry error reporting using Raven JS.  This library uses a single instance of Raven to manually capture exceptions in the React lifecycle method componentDidCatch.

### Installation

```
npm install --save-dev react-sentry-error-boundary
```

### Requirements

#### Peer Dependencies
```
prop-types >=15.5.0
raven-js >=3.26.3
react >=16.0.0
```

### Usage

```js
import MyWidget from './MyWidget'
import SentryErrorBoundary from 'react-sentry-error-boundary'
import React from 'react'

const App = () =>
  <SentryErrorBoundary dsn="https://<key>@sentry.io/<project>">
    <MyWidget />
  </SentryErrorBoundary>

export default App
```

### Props

#### config
[Documentation](https://docs.sentry.io/clients/node/config/)
```
A Sentry configuration object.
```

#### dsn
[Documentation](https://docs.sentry.io/quickstart/#configure-the-dsn)
```
REQUIRED. A Sentry DSN URL.
```

#### errorCallback
```
A callback function to execute on error.
```

#### errorNode
```
A node to render on error.
```

#### logErrors
```
A bool indicating whether errors are logged to Sentry. Defaults to true.
```

#### userContext
[Documentation](https://docs.sentry.io/learn/context/)
```
A Sentry user context object.
```

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