# pagerduty

> A node.js client for PagerDuty

Latest version **0.0.3** (published 2012-01-13) · 0 weekly downloads

## Install

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

## 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 | 2012-01-13 |
| First published | 2012-01-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Karl Skomski |
| Maintainers | skomski |

## Links

- npm: https://www.npmjs.com/package/pagerduty
- Repository: https://github.com/skomski/node-pagerduty
- npm.io page: https://npm.io/package/pagerduty

## Dependencies (1)

- [request](https://npm.io/package/request.md) ~2.9.3

## Recent versions

- 0.0.3 (latest) — 2012-01-13
- 0.0.2 — 2012-01-09
- 0.0.1 — 2012-01-09
- 0.0.0 — 2012-01-09

## README

# pagerduty

A node.js client for PagerDuty.

## Install

```
npm install pagerduty
```

## Methods

### constructor(options)
  * Required:
    * `serviceKey` - The GUID of one of your “Generic API” services. This is the “service key” listed on a Generic API’s service detail page.

### create(options)
  * Required:
    * `description` - A short description of the problem that led to this trigger.
  * Optional:
    * `details` - An arbitrary JSON object containing any data you’d like included in the incident log.
    * `incidentKey` - Identifies the incident to which this trigger event should be applied.
    * `callback` - A Callback with two arguments `(err, response)`

### acknowledge(options)
  * Required:
    * `incidentKey` - Identifies the incident to which this trigger event should be applied.
  * Optional:
    * `details` - An arbitrary JSON object containing any data you’d like included in the incident log.
    * `description` - Text that will appear in the incident’s log associated with this event.
    * `callback` - A Callback with two arguments `(err, response)`

### resolve(options)
  * Required:
    * `incidentKey` - Identifies the incident to which this trigger event should be applied.
  * Optional:
    * `details` - An arbitrary JSON object containing any data you’d like included in the incident log.
    * `description` - Text that will appear in the incident’s log associated with this event.
    * `callback` - A Callback with two arguments `(err, response)`

### Example response

```json
{ 
  status: 'success',
  incident_key: '87fb80301f99012f961a1231381bc5dc',
  message: 'Event processed'
}
```

## Usage

```javascript
var pager, PagerDuty;

PagerDuty = require('pagerduty');

pager = new PagerDuty({
  serviceKey: '12345678901234567890123456789012' // required
});

pager.create({
  description: 'testError', // required
  details: {
    foo: 'bar'
  },
  callback: function(err, response) {
    if (err) throw err;

    pager.acknowledge({
      incidentKey: response.incident_key, // required
      description: 'Got the test error!',
      details: {
        foo: 'bar'
      },
      callback: function(err, response) {
        if (err) throw err;

        pager.resolve({
          incidentKey: response.incident_key, // required
          description: 'Resolved the test error!',
          details: {
            foo: 'bar'
          },
          callback: function(err, response) {
            if (err) throw err;
          }
        });
      }
    });
  }
});
```

## License

Licensed under the MIT license.

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