# ember-cli-bugsnag-reporter

> Integrates Bugsnag reporting service into your Ember CLI app.

Latest version **0.6.0** (published 2019-05-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ember-cli-bugsnag-reporter
pnpm add ember-cli-bugsnag-reporter
yarn add ember-cli-bugsnag-reporter
bun add ember-cli-bugsnag-reporter
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2019-05-29 |
| First published | 2019-01-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >6 <=10 |
| Dependencies | 6 |
| Unpacked size | 27.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | appaloosa |
| Maintainers | appaloosa |
| Keywords | ember-addon, bugsnag, error reporting |

## Links

- npm: https://www.npmjs.com/package/ember-cli-bugsnag-reporter
- Repository: https://github.com/appaloosa-store/ember-cli-bugsnag-reporter
- Homepage: https://github.com/appaloosa-store/ember-cli-bugsnag-reporter/blob/master/README.MD
- Issues: https://github.com/appaloosa-store/ember-cli-bugsnag-reporter/issues
- npm.io page: https://npm.io/package/ember-cli-bugsnag-reporter

## Dependencies (6)

- [@bugsnag/js](https://npm.io/package/@bugsnag/js.md) 6.3.0
- [@bugsnag/node](https://npm.io/package/@bugsnag/node.md) 6.3.0
- [broccoli-stew](https://npm.io/package/broccoli-stew.md) 2.1.0
- [broccoli-funnel](https://npm.io/package/broccoli-funnel.md) 2.0.2
- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^7.7.3
- [ember-auto-import](https://npm.io/package/ember-auto-import.md) 1.3.0

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.6.0 (latest) — 2019-05-29
- 0.5.2 — 2019-05-10
- 0.5.1 — 2019-05-09
- 0.5.0 — 2019-05-09
- 0.4.3 — 2019-05-07
- 0.4.2 — 2019-05-07
- 0.4.1 — 2019-05-06
- 0.4.0 — 2019-05-06
- 0.3.6 — 2019-02-07
- 0.3.5 — 2019-02-06
- 0.3.4 — 2019-02-06
- 0.3.3 — 2019-02-06
- 0.3.2 — 2019-01-07
- 0.3.1 — 2019-01-04
- 0.2.0 — 2019-01-04
- … 1 more at https://npm.io/package/ember-cli-bugsnag-reporter/versions

## README

# ember-cli-bugsnag-reporter

This addon goal is to make it easy the integration of [bugsnag](https://www.bugsnag.com) to an ember app.

## Installation

```shell
ember install ember-cli-bugsnag-reporter
```

## Reporting events

By default all ember errors are automatically reported to bugsnag you have nothing to do.

If you need to manually report bugsnag's event you should use the service `bugsnag` that is exposed by this addon.
The service as 4 methods you can use to report events :

### `error(name: string | Error, metaData?: object)`

Report a bugsnag's event with the severity set to `error`. You can include some extra data to the report with the second param `metaData` (see the bugsnag's [doc](https://docs.bugsnag.com/platforms/javascript/ember/#custom-diagnostics)).

### `warning(name: string | Error, metaData?: object)`

Report a bugsnag's event with the severity set to `warning`. You can include some extra data to the report with the second param `metaData` (see the bugsnag's [doc](https://docs.bugsnag.com/platforms/javascript/ember/#custom-diagnostics)).

### `info(name: string | Error, metaData?: object)`

Report a bugsnag's event with the severity set to `info`. You can include some extra data to the report with the second param `metaData` (see the bugsnag's [doc](https://docs.bugsnag.com/platforms/javascript/ember/#custom-diagnostics)).

### `notify(name: string | Error, options?: object)`

For this one have a look to this [page](https://docs.bugsnag.com/platforms/javascript/ember/reporting-handled-errors/).

## Configuration

To configure ember-cli-bugsnag-reporter:

Add a POJO in `config/environment.js`

```javascript
{
  "bugsnag-reporter": {
    apiKey: "",
    notifyReleaseStages: ["development", "production"]
  }
}
```

The releaseStage defaults to the current application environment, if you need to set a different releaseStage that diverges from the environment, you can pass and additional attribute to the bugsnag configuration called releaseStage. It would look like this:

```javascript
{
  "bugsnag-reporter": {
    apiKey: "",
    notifyReleaseStages: ["development", "production", "staging"],
    releaseStage: "staging"
  }
}
```

The options you can set are listed [here](https://docs.bugsnag.com/platforms/javascript/configuration-options/).

## Customization

In order to send additional data along with errors reported to Bugsnag, generate a utility named bugsnag:

```shell
ember g util bugsnag
```

_Both function takes the container as an argument._

### Custom Diagnostics (docs)

To send custom meta data, define a helper method getMetaData in the app/utils/bugsnag.js you created. getMetaData takes the error and the container as arguments, e.g.:

```javascript
export function getMetaData(/* appInstance */) {
  return {
    // …some meta data
  };
}
```

This method is called for every errors and any data returned by it are included as meta data for the respective error.

```javascript
return {
  account: {
    name: "Bugsnag",
    plan: "premium",
    beta_access: true
  }
};
```

### Identifying Users (docs)

To correlate a specific user to an error and have the information appear in the User tab in the Bugsnag UI, send user data with each error data. Define a helper method getUser in the app/utils/bugsnag.js you created.

```javascript
export function getUser(appInstance) {
  const user = appInstance.lookup('service:current-user').getUser();
  return {
    email: user.email,
    id: user.id,
    name: user.name
  };
}
```

### Uploading Sourcemaps (docs)

Uploading sourcemaps to Bugsnag makes it easier to track down errors in your code because the stacktrace for each error in the Bugsnag UI highlights the exact line in your unminified source code. To send sourcemaps Bugsnag, use the Ember CLI Deploy addon [ember-cli-deploy-bugsnag](https://github.com/binhums/ember-cli-bugsnag).

### Fastboot

This addon works with [Fastboot](http://ember-fastboot.com) without any extra configuration.

## Contributing

------------------------------------------------------------------------------

### Installation

* `git clone <repository-url>`
* `cd ember-cli-bugsnag-reporter`
* `npm install`

### Linting

* `npm run lint:js`
* `npm run lint:js -- --fix`

### Running tests

* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions

### Running the dummy application

* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).

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