# koa-error-aws-sns

> Koa - Send server errors to an AWS SNS topic - ie notifyMe

Latest version **0.0.3** (published 2016-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-error-aws-sns
pnpm add koa-error-aws-sns
yarn add koa-error-aws-sns
bun add koa-error-aws-sns
```

## 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.0.3 |
| Published | 2016-04-10 |
| First published | 2016-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | rturk |

## Links

- npm: https://www.npmjs.com/package/koa-error-aws-sns
- Repository: https://github.com/rturk/koa-error-sns
- Homepage: https://github.com/rturk/koa-error-aws-sns#readme
- Issues: https://github.com/rturk/koa-error-aws-sns/issues
- npm.io page: https://npm.io/package/koa-error-aws-sns

## Recent versions

- 0.0.3 (latest) — 2016-04-10
- 0.0.2 — 2016-04-10
- 0.0.1 — 2016-04-03

## README

# koa-error-sns
This Middleware detects errors in Koa Servers and sends messages to an AWS SNS topic. SNS is a fan-out message distribution system from AWS. From SNS you can set up different subscribers; such as email subscribers address, SQS queues or Lambda function. Simple use case is subscribe an email address to the SNS topic that will receive all error messages.

## How it works
The Middleware will listen to errors thrown from downstream components using try & catch. Once an error is detected a message containing error detail as well other relevant information (context, request and whenever possible response information) will be published to your SNS endpoint.

The Middleware code is lightweight and is intended to be used in production environments. AWS is only called when an error is detected.

Please note that this middleware will solely catch errors from downstream components, so in order to catch relevant errors it must be one of the first middleware installed the Koa initialization stack.

## Usage
```js
import errorToSNS from 'koa-error-aws-sns';
import AWS from 'aws-sdk';

const sns = new AWS.SNS({ params: { TopicArn: 'arn:aws:sns:us-east-1:12345678910101:endpoint' },
                          region: 'us-east-1',
                        });

const app = new Koa();
app.use(errorToSNS(sns);
```

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