@knetik/micro-knetikcloud

3.1.8 • Public • Published

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 }));
});

Readme

Keywords

none

Package Sidebar

Install

npm i @knetik/micro-knetikcloud

Weekly Downloads

1

Version

3.1.8

License

MIT

Unpacked Size

2.81 kB

Total Files

5

Last publish

Collaborators

  • knetik