# aurelia-sentry

> An Aurelia Sentry/Raven LogAppender.

Latest version **5.0.0** (published 2024-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install aurelia-sentry
pnpm add aurelia-sentry
yarn add aurelia-sentry
bun add aurelia-sentry
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2024-06-23 |
| First published | 2016-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom Newby |
| Keywords | aurelia, logging |

## Links

- npm: https://www.npmjs.com/package/aurelia-sentry
- Repository: https://github.com/Vheissu/aurelia-typescript-plugin
- Homepage: http://tomnewby.net
- Issues: https://github.com/tomtomau/aurelia-sentry
- npm.io page: https://npm.io/package/aurelia-sentry

## Dependencies (5)

- [@sentry/browser](https://npm.io/package/@sentry/browser.md) ^8.0.0
- [aurelia-framework](https://npm.io/package/aurelia-framework.md) ^1.4.1
- [aurelia-polyfills](https://npm.io/package/aurelia-polyfills.md) ^1.2.2
- [aurelia-loader-webpack](https://npm.io/package/aurelia-loader-webpack.md) ^2.2.1
- [aurelia-event-aggregator](https://npm.io/package/aurelia-event-aggregator.md) latest

## 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

- 5.0.0 (latest) — 2024-06-23
- 4.0.0 — 2022-10-26
- 3.0.0 — 2021-11-16
- 2.1.0 — 2020-01-21
- 2.0.0 — 2019-04-08
- 0.2.0 — 2018-04-29
- 0.1.3 — 2016-10-13
- 0.1.1 — 2016-10-12
- 0.1.0 — 2016-07-12

## README

# aurelia-sentry

A wrapper around [Sentry](https://sentry.io/)'s [Browser client](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser) to be added to Aurelia's LogManager.

## Usage

Install the package:

```bash
$ yarn add aurelia-sentry
```

Add the library to your base template - this will catch more errors before Aurelia has chance to boot.

```html
<script src="https://browser.sentry-cdn.com/8.0.0/bundle.min.js"
        crossorigin="anonymous"
></script>
<!-- Configure your DSN here too -->
<script>Sentry.init({ dsn: '{{ sentry_dsn }}' });</script>
```

Then update your main.js in Aurelia to add the SentryAppender as early as possible.

```javascript
// main.js
import { LogManager } from 'aurelia-framework';
import { SentryAppender } from 'aurelia-sentry';

LogManager.addAppender(new SentryAppender());
LogManager.setLevel(LogManager.logLevel.error);

export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging();
  
  aurelia.start().then(() => aurelia.setRoot());
}
```

## Configuration

You may optionally configure a minimum level to be logged:

```javascript
import { LogManager, ConsoleAppender } from 'aurelia-framework';
import { SentryAppender } from 'aurelia-sentry';

if (typeof (window as any).Sentry !== 'undefined') {
  LogManager.addAppender(new SentryAppender({ minLevel: Levels.error}));
  LogManager.setLevel(LogManager.logLevel.warn);
} else {
  LogManager.setLevel(LogManager.logLevel.debug);
}

LogManager.addAppender(new ConsoleAppender());

```

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