# beeswax-client

> Node.js wrapper for the Beeswax API.

Latest version **0.4.0** (published 2016-06-29) · MIT license · 0 weekly downloads

## Install

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

## 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.4.0 |
| Published | 2016-06-29 |
| First published | 2016-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Reelcontent, Inc. |
| Maintainers | howardengelhart, leichter |
| Keywords | beeswax, advertising, ads, rest |

## Links

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

## Dependencies (4)

- [request](https://npm.io/package/request.md) ^2.72.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.0
- [ssl-root-cas](https://npm.io/package/ssl-root-cas.md) ^1.1.10
- [request-promise](https://npm.io/package/request-promise.md) ^3.0.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.4.0 (latest) — 2016-06-29
- 0.3.0 — 2016-06-28
- 0.2.0 — 2016-06-21
- 0.1.1 — 2016-05-23
- 0.1.0 — 2016-05-19

## README

beeswax-client
==============

Node.js wrapper for the Beeswax API.

Install
-------
```bash
$> npm install beeswax-client
```

Usage
-----

### Instantiation

Instantiate with an options object:
```javascript
var BeeswaxClient = require('beeswax-client');

var beeswax = new BeeswaxClient({
    apiRoot: 'https://<hostname>',  // Default: 'https://stingersbx.api.beeswax.com'
    creds: {
        email       : 'user@domain.com',    // required
        password    : '...'                 // required
    }
});
```

The `apiRoot` will be used to construct request urls, and the `creds` will be used when authenticating.

The instantiated client will contain methods for performing CRUD operations on each supported entity:
```javascript
beeswax.advertisers.find = function() {}
beeswax.advertisers.query = function() {}
beeswax.advertisers.create = function() {}
beeswax.advertisers.edit = function() {}
beeswax.advertisers.delete = function() {}

beeswax.campaigns.find = function() {}
// ...

beeswax.creatives.find = function() {}
// ...
```

Currently supported entities are:

- advertisers
- campaigns
- creatives


### `beeswax.authenticate()`
Sends a POST request to authenticate to Beeswax, using the provided `creds`.
You shouldn't need to call this method explicitly - it will be called automatically upon receiving an Unauthorized response from any other request.

### `beeswax.<entity>.find(id)`
Send a GET request to fetch the entity with the given id.

### `beeswax.<entity>.query(body)`
Send a GET request to fetch entities. `body` should be an object containing any fields to query by. By default, Beeswax's API will fetch up to 50 records, starting with the oldest.

### `beeswax.<entity>.queryAll(body)`
Like `query()`, but recursively sends GET requests until all entities matching the query have been fetched.

### `beeswax.<entity>.create(body)`
Send a POST request to create a new entity. `body` should be an object representing the new entity.

### `beeswax.<entity>.edit(id, body, failOnNotFound)`
Send a PUT request to update the entity specified by `id`. `body` should be an object containing any fields that should be updated.

### `beeswax.<entity>.delete(id, failOnNotFound)`
Send a DELETE request to delete the entity specified by `id`

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