# baabedo

> Baabedo API wrapper for Node.js and the Browser

Latest version **0.3.0** (published 2015-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install baabedo
pnpm add baabedo
yarn add baabedo
bun add baabedo
```

## 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.3.0 |
| Published | 2015-09-29 |
| First published | 2015-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+10 in 2 direct dependencies) |
| Install scripts | no |
| Author | Baabedo |
| Maintainers | michaelhirn |
| Keywords | baabedo, amazon, pricing, ecommerce, api |

## Links

- npm: https://www.npmjs.com/package/baabedo
- Repository: https://github.com/baabedo/baabedo-js
- Issues: https://github.com/baabedo/baabedo-js/issues
- npm.io page: https://npm.io/package/baabedo

## Dependencies (3)

- [qs](https://npm.io/package/qs.md) ^2.4.1
- [lodash](https://npm.io/package/lodash.md) ^3.1.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.6

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2015-09-29
- 0.2.2 — 2015-09-28
- 0.2.1 — 2015-09-28
- 0.2.0 — 2015-09-27
- 0.1.1 — 2015-09-16
- 0.1.0 — 2015-09-09
- 0.0.5 — 2015-09-06
- 0.0.4 — 2015-09-06
- 0.0.3 — 2015-09-06
- 0.0.2 — 2015-09-01

## README

# Baabedo API JS-Client for Node and Browser

The package can be used in node.js and browser environments. Just
`require('baabedo')`. If you want to use it in your client/browser app, just
`browserify` your app, which requires `baabedo`.

## Installation

`npm install baabedo`

To get a js file you can use in the frontend run  
```bash
$ npm install -g browserify
$ browserify lib/baabedo.js -o bundle.js -s Baabedo
```

> Note: You can specify a custom API url by providing the ENV variable `BAABEDO_API_URL`

## API Overview

Every resource is accessed via your `baabedo` instance:

```js
var baabedo = require('baabedo')(' your baabedo access_token ');
// baabedo.{ RESOURCE_NAME }.{ METHOD_NAME }
```

Every resource method accepts an optional callback as the last argument:

```js
baabedo.channels.create(
  { marketplace_type: 'Amazon' },
  function(err, channel) {
    err; // null if no error occurred
    channel; // the created channel object
  }
);
```

Additionally, every resource method returns a promise, so you don't have to use the regular callback. E.g.

```js
// Create a new customer and then a new charge for that customer:
baabedo.channels.create({
  marketplace_type: 'Amazon'
}).then(function(channel) {
  return baabedo.channel.createProduct(channel.id, {
    name: 'Blue Socks',
    min_price: 1600,
    currency: 'usd',
  });
}).then(function(charge) {
  // New charge created on a new customer
}, function(err) {
  // Deal with an error
});
```

### Available resources & methods

*Where you see `params` it is a plain JavaScript object, e.g. `{ email: 'foo@example.com' }`*

 * __Channels__
  * `create(params)`
  * `list([params])`
  * `retrieve(channelId)`
  * `del(channelId)`
  * _Products_
  * `createProduct(channelId)`
  * `createProducts(channelId)`
  * `updateProducts(channelId)`
  * `listProducts(channelId)`
  * `retrieveProduct(channelId, productId)`
  * `updateProduct(channelId, productId)`
  * _ProductOrders_
  * `createProductOrders(channelId)`
  * `updateProductOrders(channelId)`
  * `listProductOrders(channelId)`
  * `updateProductOrder(channelId, OrderItemId)`
  * _Statistics_
  * `retrieveStatisticsProfit(channelId)`
  * `retrieveStatisticsRevenue(channelId)`
  * _Search_
  * `searchProducts(channelId)`
 * __Payment_Plans__
  * `list([params])`
  * `updateSubscription(params)` _not yet implemented_
  * `cancelSubscription(params)` _not yet implemented_
 * __Payment_Information__
  * `list([params])`
  * `update(params)` _not yet implemented_
  * `retrieveClientToken(params)` _not yet implemented_


## Configuration

 * `baabedo.setApiKey(' your secret api key ');`
 * `baabedo.setTimeout(20000); // in ms` (default is node's default: `120000ms`)

## Development

Run the tests using [`npm`](https://www.npmjs.com/):

```bash
$ npm install
$ npm test
```
## [License](LICENSE)

Copyright (C) 2015 [Storeness](http://storeness.de)

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