- Tested against PagerDuty REST API v2
- For Node.js you will need the xmlhttprequest library.
If you are using Node.js, install jsPagerDuty using npm:
$ npm install jspagerduty
You can now require and use jspagerduty like so:
let PagerDutyAPI =const PAGERDUTY_EMAIL = processenvPAGERDUTY_EMAILconst PAGERDUTY_TOKEN = processenvPAGERDUTY_TOKENlet pdapi = PAGERDUTY_EMAIL PAGERDUTY_TOKENpdapipdapi
You can also load this script on your browser like so:
You can now use the class PagerDutyAPI normally on the page, like you would on Node.js.