@cordxapp/instatus
TypeScript icon, indicating that this package has built-in type declarations

0.4.18 • Public • Published

Instatus Client

Simple yet efficient client for the Instatus API. It provides methods to fetch user profiles, status pages, components, incidents, and subscribers.

Installation

npm install @cordxapp/instatus

Usage

To use the module you will new to import it and create a new client:

import { InstatusClient } from '@cordxapp/instatus';

const instatus = new InstatusClient({
    apiKey: 'API_KEY',
    apiVersion: 'API_VERSION'
});

Methods

Here are the methods provided by the InstatusClient class:

getUserProfile()

Fetches the user profile information:

instatus.getUserProfile();

getStatusPages()

Fetches an array of the status pages in your team/workspace:

instatus.getStatusPages();

getQueriedStatusPages(query)

Fetches a queried array of the status pages in your team/workspace:

instatus.getQueriedStatusPages({ page: 1, per_page: 20 });

getComponents({ pageId })

Fetches an array of all the components in your status page:

instatus.getComponents({ pageId: 'some_page_id' });

getComponent({ id, pageId })

Fetches a status page component by ID:

instatus.getComponent({ id: 'some_component_id', pageId: 'some_page_id' });

getIncidents({ pageId })

Fetches a list of incidents:

instatus.getIncidents({ pageId: 'some_page_id' });

getQueriedIncidents(pageId, query)

Fetches a queried list of incidents:

instatus.getQueriedIncidents('some_page_id', { page: 1, per_page: 20 });

getIncident(pageId, id)

Fetches an incident by ID:

instatus.getIncident('some_page_id', 'some_incident_id');

getSubscribers(pageId, query)

Fetches a list of people subscribed to your status page:

instatus.getSubscribers('some_page_id', { page: 1, per_page: 20 });

Error Handling

// TODO: Add information about how errors are handled and what kind of errors can be expected.


API Rate Limiting

// TODO: Add information about any rate limiting imposed by the Instatus API and how users can handle it.


Support

If you encounter any issues or have questions, please file an issue in our issue tracker.

Contributing

Contributions are welcome. Please submit a pull request or create an issue to discuss what you would like to change.

Readme

Keywords

none

Package Sidebar

Install

npm i @cordxapp/instatus

Weekly Downloads

1

Version

0.4.18

License

none

Unpacked Size

64.2 kB

Total Files

24

Last publish

Collaborators

  • cordxapp