Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.34 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.34 KB

statuscake-js test

NOTE: This library is in alpha and not production ready. Whilst it can be used we will not offer support until it is generally available.

The JavaScript implementation of the StatusCake API client. Documentation for this library can be found here.

Prerequisites

You will need the following things properly installed on your computer:

Installation

With NPM, run the following command

npm install --save "@statuscake/statuscake-js"

to add the package to your package.json file.

Usage

Import the package from any JavaScript/TypeScript file, instantiate an API client and execute a request:

import 'isomorphic-fetch';
import {
  Configuration,
  UptimeApi,
} from '@statuscake/statuscake-js';

const config = new Configuration({
  headers: {
    'Authorization': `Bearer ${apiToken}`,
  },
});

const service = new UptimeApi(config);
service.listUptimeTests()
  .then((tests) => console.log(JSON.stringify(tests)))
  .catch(console.log);

License

This project is licensed under the MIT License.