1.0.2 • Published 3 years ago
@ekoopensource/sdk v1.0.2
EkoOpenBuild Node.js sdk
Nodejs API wrapper for EkoOpenSource
Table of content
Documentation
Take a look at the API Docs here
Installation
Install the package from npm by running
$ npm install @ekoopensource/sdk
or
$ yarn add @ekoopensource/sdk
Usage
To use this sdk you need to first generate your API keys by registering as a node on Ekoopensource.
import { EOS } from '@ekoopensource/sdk';
const credentials = {
clientId: 'CLIENT_KEY', // Your EkoopenSource CLIENTID goes Here
clientSecret: 'SK_{SECRET_KEY}' // Your EkoopenSource CLIENTSECRET goes Here
};
const EosSdk = new EOS(credentials)
// Initiate the environment (optional)
EosSdk.setEnviroment("live");
// Call A Node Fetch API
try{
const doctors = await EosSdk.fetchData("health","doctors");
// do something with the doctors result
}
catch (e) {
// catch Exception Error
}
// Call A Node POST API
try{
const doctors = await EosSdk.postData("health","doctors", {
...
});
// do something with the doctors result
}
catch (e) {
// catch Exception Error
}