bardog-eal-js
v0.2.2
Published
Library to interact with EAL API from any JS based project
Downloads
3
Maintainers
Readme
EAL JS
Library to interact with EAL API from any JS based project.
Installation
With NPM
npm install --save bardog-eal-js
With YARN
yarn add bardog-eal-js
First steps
Import the package from your JS project:
import EAL from 'bardog-eal-js'
Use it on your project:
const EventManager = new EAL({
user: 'YOUR_EAL_USERNAME',
password: 'YOUR_EAL_PASSWORD'
});
// Adding an event
EventManager.addEvent({
user: {
id: 4903,
username: 'myusername',
email: '[email protected]'
},
business: {
id: 601,
name: 'Test Organization'
},
action: {
datetime: (new Date()).toISOString(),
name: 'My first action',
category: 'General actions'
}
});
Supported methods
:: addEvent
- Description: adds a single event through EAL API.
- Returns a Promise.
- Params:
{ user: { //optional id, username, email, firstName, //optional lastName, //optional phone, //optional extraFields: {}, //optional }, business: { id, name, email, //optional phone, //optional website, //optional extraFields: {} //optional }, action: { datetime, name, category, //optional object: { //optional id, className, before, //optional after, //optional }, extraFields: {}, //optional } }
:: addEvents
- Description: adds multiple events through EAL API.
- Returns a Promise.
- Params:
{ user: { //optional id, username, email, firstName, //optional lastName, //optional phone, //optional extraFields: {}, //optional }, business: { id, name, email, //optional phone, //optional website, //optional extraFields: {} //optional }, actions: [{ datetime, name, category, //optional object: { //optional id, className, before, //optional after, //optional }, extraFields: {}, //optional }] }
:: resetSessionToken
- Description: reset the EAL activity session token.
- Returns nothing.
- Params: none.