# breachsignal

> Breachsignal library

Latest version **1.6.2** (published 2016-08-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install breachsignal
pnpm add breachsignal
yarn add breachsignal
bun add breachsignal
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.6.2 |
| Published | 2016-08-17 |
| First published | 2015-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Breachsignal |
| Maintainers | breachsignal |
| Keywords | security analytics, security monitoring, anomaly detection, application attack, zero-day attack, security breach, account abuse, account fraud, data leak |

## Links

- npm: https://www.npmjs.com/package/breachsignal
- Repository: https://github.com/breachsignal/breachsignal-nodejs
- Homepage: http://breachsignal.com
- Issues: https://github.com/breachsignal/breachsignal-nodejs/issues
- npm.io page: https://npm.io/package/breachsignal

## Recent versions

- 1.6.2 (latest) — 2016-08-17
- 1.6.1 — 2016-08-12
- 1.6.0 — 2016-07-30
- 1.4.10 — 2016-07-14
- 1.4.9 — 2016-07-06
- 1.4.8 — 2016-07-04
- 1.4.7 — 2016-07-03
- 1.4.6 — 2016-07-02
- 1.4.5 — 2016-06-27
- 1.4.4 — 2016-06-02
- 1.4.3 — 2016-05-31
- 1.4.2 — 2016-05-18
- 1.4.1 — 2016-05-18
- 1.4.0 — 2016-05-17
- 1.3.3 — 2016-05-01
- … 8 more at https://npm.io/package/breachsignal/versions

## README

### Overview

Breachsignal is used for monitoring and analyzing user behaviour, enabling detection and prevention of security issues and account fraud. By monitoring every user, Breachsignal’s large-scale machine learning detects and reports application usage anomalies providing full anomaly context.

User transaction (request/response) information needs to be sent to Breachsignal for anomaly detection. This can be done using this library as well as via transactions API.

Detected anomalies can be analyzed in the dashboard or accessed using this library or via signals API.

Learn more at [breachsignal.com/product](http://breachsignal.com/product/).



### Installation

Make sure you have a Breachsignal account before continuing. You can signup at [breachsignal.com](http://breachsignal.com).


```term
npm install breachsignal --save
```


### Usage

#### Tracking user transactions automatically:

```javascript
var breachsignal = require('breachsignal');

breachsignal.init({
  apiKey: 'API_KEY',
  appName: 'MyApp'
});

// should be called before the server starts listening
breachsignal.trackHttpRequests();
```

If user ID cannot be found in `req.user` or `req.session.user` objects
under `user_id`, `id` or `_id` properties, use `identifyUser` method to associate user ID
with request object on each request.
```
breachsignal.identifyUser(req, 'USER_ID');
```


#### Tracking user transactions programmatically:

```javascript
var breachsignal = require('breachsignal')

breachsignal.init({
  apiKey: 'API_KEY',
  appName: 'MyApp'
});

...

breachsignal.track({
  client_ip: '203.0.113.1', // required
  user_id: '12345', // required
  url: '/user/login', // required
  method: 'PUT',
  request_size: 100,
  response_size: 0,
  status_code: 200
});

```


#### Receiving detected anomaly signals:

```javascript
breachsignal.on("signal", function(signal) {
  // use signal.user_id, signal.client_ip and signal.score
});
```


#### Troubleshooting

For troubleshooting add `debug:true` flag to initialization options. A debug log will be written to STDIN and STDERR. If it doesn’t give you any hints on how to correct the problem, report the problem to Breachsignal Support from your account with the attached debug log.


Full documentation is available at [breachsignal.com/docs](http://breachsignal.com/docs/).

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