@knetik/micro-knetikcloud

This package adds a customer scoped instance of the javascript knetikcloud sdk to [micro-core](https://www.npmjs.com/package/@knetik/micro-core) the multi tenant framework.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@knetik/micro-knetikcloud
Minified + gzip package size for @knetik/micro-knetikcloud in KB

Readme

Knetik Micro KnetikCloud

This package adds a customer scoped instance of the javascript knetikcloud sdk to micro-core the multi tenant framework.

When a customer connects to a micro-core application, the required app_id and optional access token are passed into the knetikcloud sdk. Creating an sdk instance scoped to this this customer.

In micro-console

App.connect(app_id, access_token)
.then(App => App.KnetikCloud.get('ContentArticlesApi'))
.then(api => api.getArticles())
.then(res => console.log(res))
.catch(err => console.log(err))

In a micro-core module

module.exports (App) => {
  App.KnetikCloud.get('ContentArticlesApi')
}

In a micro-core express route

Server.get('/articles', (req, res) => {
  const api = req.App.Knetikcloud.get('ContentArticlesApi');

  api.getArticles(req.query)
  .then(result => res.json({ resp: result }))
  .catch(err => res.status(422).json({ err }));
});

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.