Skip to content

ibp-network/api-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api-js

API for ibp-monitor (js)

Dependencies

Example usage

// const IbpApi = require('ibp-api');
import { IbpApi } from './index.js';

let api = new IbpApi({
  // the url of the ibp-monitor operator
  url: 'https://ibp-monitor.operator.com',
  // the apiKey is provided by the ibp-monitor operator
  apiKey: 'my-api-key'
});

// create listener
api.on('healthCheck', (event) => {
  console.log('A healthCheck was created!', event);
});

// Subscribe to '<model>.<event>'
api.subscribe('healthCheck');

// After some time, unsubscribe from 'user.created' event.
setTimeout(() => {
  api.unsubscribe('healthCheck');
}, 10000);

Releases

No releases published

Packages

No packages published