# bonusly-client

> A nodejs client that consumes the Bonusly API to retrieve/send bonuses

Latest version **1.0.11** (published 2015-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install bonusly-client
pnpm add bonusly-client
yarn add bonusly-client
bun add bonusly-client
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2015-09-28 |
| First published | 2015-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nick Luo |
| Maintainers | nick.luo |
| Keywords | bonus, bonusly |

## Links

- npm: https://www.npmjs.com/package/bonusly-client
- Repository: https://github.com/nluo/bonusly-node-client
- Homepage: https://github.com/nluo/bonusly-node-client#readme
- Issues: https://github.com/nluo/bonusly-node-client/issues
- npm.io page: https://npm.io/package/bonusly-client

## Dependencies (2)

- [kgo](https://npm.io/package/kgo.md) ^2.0.5
- [request](https://npm.io/package/request.md) ^2.61.0

## Recent versions

- 1.0.11 (latest) — 2015-09-28
- 1.0.10 — 2015-09-28
- 1.0.9 — 2015-09-01
- 1.0.8 — 2015-08-31
- 1.0.7 — 2015-08-30
- 1.0.6 — 2015-08-30
- 1.0.5 — 2015-08-30
- 1.0.4 — 2015-08-30
- 1.0.3 — 2015-08-30
- 1.0.2 — 2015-08-30
- 1.0.1 — 2015-08-30
- 1.0.0 — 2015-08-30

## README

## What

A node client that consumes the Bonusly API to (currently support) retrieve/send bonuses

## Quick Reference

#### Installation
```javascript
  npm i --save bonusly-client
```

#### Use it

```javascript
var BonuslyClient = require('bonusly-client'),
    client = new BonuslyClient('Your Access Token');
```


#### Retrive bonuses:

To retrieve all the bonuses, you simply call the getBonuses method with callback:

```javascript
client.getBonuses(function(error, results) {
    if (error) {
      console.log('some error occurs: ', error);
    }
    console.log('The list of bonuses are', results);
});

```

#### Retrieve a specific bonus

 To get a specific bonus detail call the getBonus function with the bonusID:

 API
 ```javascript
 client.getBonus(bonusId, callback);
 ```

Example:

```javascript
client.getBonus('55a3555f6c8277476500000c', function(error, result){
    ...
});
```

#### Give Bonus to someone

API:
```javascript
client.giveBonus(receiverEmail, reason, amount, callback);
```
To create a bonus for someone, you would need to pass the receiverEmail, reason and the amount of the bonus:

Example:

```javascript
client.giveBounus('bob.smith@majigger.com', 'Because bob is awesome', 20, function(error, result){
  if (error) {
    console.log('oops could not send bonus to bob, error is: ', error);
  }
  console.log('Successfully give 20 bounuses points to Bob because he is awesome! ', result);
});

```

## Test

```
npm test
```

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