@phoenixdev/epsilondigital-rest-api
v1.0.2
Published
A Node.js wrapper for the Epsilondigital REST API
Maintainers
Readme
Epsilondigital API - Node.js Client
A Node.js client for the Epsilondigital REST API. Easily interact with the Epsilondigital REST API using this library.
Installation
npm i @phoenixdev/epsilondigital-rest-apiyarn add @phoenixdev/epsilondigital-rest-apiGetting started
GET API credentials from Epsilondigital .
Setup
Setup for the REST API integration :
const EpsilondigitalRestApi = require('@phoenixdev/epsilondigital-rest-api');
const epsilondigital = new EpsilondigitalRestApi({
subscriptionKey: 'xxxx',
email: 'xxxx',
password: 'xxxx',
sandbox: false,
autoLogin: true,
});Options
| Option | Type | Required | Description |
| ----------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| subscriptionKey | String | yes | Your subscription key |
| email | String | yes | Your email |
| password | String | yes | Your password |
| sandbox | Boolean | no | Define if is sandox or not.Default is false |
| autoLogin | Boolean | no | Auto login to Epsilondigital and store jwt for next requests |
| encoding | String | no | Encoding, default is utf-8 |
| timeout | Integer | no | Define the request timeout, default is 30 sec |
| axiosConfig | Object | no | Define the custom Axios config, also override this library options |
Methods
POST
.post( data, endpoint ).post( data, endpoint, params )
| Params | Type | Description |
| ---------- | -------- | ----------------------------------------------------------- |
| data | Object | JS object to be converted into JSON and sent in the request |
| endpoint | String | Epsilondigital endpoint |
| params | Object | Query strings params |
LOGIN
.login( params )
| Params | Type | Description |
| -------- | -------- | -------------------- |
| params | Object | Query strings params |
REFRESH
.refresh( params )
| Params | Type | Description |
| -------- | -------- | -------------------- |
| params | Object | Query strings params |
CHECKTOKEN
.checkToken( endpoint )
| Params | Type | Description |
| ---------- | -------- | ---------------------------------------------------------------------- |
| endpoint | String | Epsilondigital endpoint. If endpoint is login or refresh exit function |
Example of use can see in test and test with
yarn testor
npm testRelease History
- 2024-09-19 - v1.0.0 - Initial release.
- 2024-09-19 - v1.0.1 - Readme update.
- 2024-10-04 - v1.0.2 - Fix refresh token.
