@statuscake/statuscake-js
v1.1.0-beta.1
Published
StatusCake API client
Downloads
19
Readme
statuscake-js
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.