@ekoopensource/sdk
Version:
Ekoopensource sdk to connect to the ekoopnsource grids and services
69 lines (47 loc) • 1.45 kB
Markdown
> Nodejs API wrapper for [EkoOpenSource](https://ekoopensource.com)
[](https://www.npmjs.org/package/@ekoopensource/sdk)
* [Documentation](
* [Installation](
* [Usage](
Take a look at the [API Docs here](https://docs.ekoopensource.com/)
Install the package from [npm](https://www.npmjs.com/package/eos-sdk-js) by running
```bash
$ npm install @ekoopensource/sdk
```
or
```bash
$ yarn add @ekoopensource/sdk
```
To use this sdk you need to first generate your API keys by registering as a node on Ekoopensource.
```javascript
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
}