# bardog-eal-js

> Library to interact with EAL API from any JS based project

Latest version **0.2.2** (published 2019-02-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install bardog-eal-js
pnpm add bardog-eal-js
yarn add bardog-eal-js
bun add bardog-eal-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2019-02-12 |
| First published | 2019-01-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | BarDogTech |
| Maintainers | bardogtech |
| Keywords | event, log, user, activity, organization, business |

## Links

- npm: https://www.npmjs.com/package/bardog-eal-js
- Repository: https://github.com/bardog/eal-js
- Homepage: https://github.com/bardog/eal-js#readme
- Issues: https://github.com/bardog/eal-js/issues
- npm.io page: https://npm.io/package/bardog-eal-js

## Dependencies (5)

- [axios](https://npm.io/package/axios.md) ^0.18.0
- [base-64](https://npm.io/package/base-64.md) ^0.1.0
- [lodash.get](https://npm.io/package/lodash.get.md) ^4.4.2
- [lodash.random](https://npm.io/package/lodash.random.md) ^3.2.0
- [@callstack/async-storage](https://npm.io/package/@callstack/async-storage.md) ^1.1.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2019-02-12
- 0.2.1 — 2019-01-23
- 0.2.0 — 2019-01-23
- 0.1.9 — 2019-01-22
- 0.1.8 — 2019-01-22
- 0.1.7 — 2019-01-22
- 0.1.6 — 2019-01-22
- 0.1.5 — 2019-01-22
- 0.1.4 — 2019-01-17
- 0.1.3 — 2019-01-16
- 0.1.2 — 2019-01-16
- 0.1.1 — 2019-01-16
- 0.1.0 — 2019-01-16

## README

![](https://img.shields.io/npm/v/bardog-eal-js.svg)

# 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:

```javascript
import EAL from 'bardog-eal-js'
```

Use it on your project:

```javascript
const EventManager = new EAL({
    user: 'YOUR_EAL_USERNAME',
    password: 'YOUR_EAL_PASSWORD'
});

// Adding an event
EventManager.addEvent({
    user: {
      id: 4903,
      username: 'myusername',
      email: 'user@mailinator.com'
    },
    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.

---
_Source: https://npm.io/package/bardog-eal-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
