# flatmarket-client

> A browser client for Flatmarket.

Latest version **3.0.1** (published 2016-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install flatmarket-client
pnpm add flatmarket-client
yarn add flatmarket-client
bun add flatmarket-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 | 3.0.1 |
| Published | 2016-08-19 |
| First published | 2015-07-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 4.x |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | christophercliff |

## Links

- npm: https://www.npmjs.com/package/flatmarket-client
- Repository: https://github.com/christophercliff/flatmarket/tree/master/packages/flatmarket-client
- npm.io page: https://npm.io/package/flatmarket-client

## Dependencies (7)

- [joi](https://npm.io/package/joi.md) ^6.6.0
- [boom](https://npm.io/package/boom.md) ^2.8.0
- [xhr2](https://npm.io/package/xhr2.md) ^0.1.3
- [lodash](https://npm.io/package/lodash.md) ^3.10.0
- [reqwest](https://npm.io/package/reqwest.md) ^2.0.1
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.30
- [flatmarket-validation](https://npm.io/package/flatmarket-validation.md) ^3.0.1

## Recent versions

- 3.0.1 (latest) — 2016-08-19
- 3.0.0-beta.1 (lerna-temp) — 2016-08-05
- 3.0.0-beta.3 — 2016-08-18
- 3.0.0-beta.2 — 2016-08-18
- 1.1.1 — 2016-02-01
- 1.1.0 — 2015-11-18
- 1.0.1 — 2015-08-19
- 1.0.0 — 2015-08-14
- 0.0.0 — 2015-07-25

## README

# flatmarket-client

A browser client for [Flatmarket](https://github.com/christophercliff/flatmarket).

## Installation

```
npm install flatmarket-client
```

## Usage

```js
var flatmarket = require('flatmarket-client').create({
    host: 'your-flatmarket-server.com',
})
flatmarket.getStatus()
    .then(function (status) {})
    .caught(function (err) {})
```

## API Reference

- [`Client.create(options)`](#clientcreateoptions)
- [`Client` Instance Methods](#client-instance-methods)
    - [`client.createCharge(options)`](#clientcreatechargeoptions)

### `Client.create(options)`

Creates the client.

```js
var client = Client.create(options)
```

##### **`options`** `Object`

- **`host`** `String`

    The host. *Required*.

- **`pathname`** `String`

    The pathname. Default `'/'`.

### `Client` Instance Methods

#### `client.createCharge(options)`

Creates the charge.

```js
client.createCharge(options)
    .then(function (payload) {})
```

##### **`options`** `Object`

- **`email`** `String`

    The email. *Required*.

- **`metadata`** `Object`

    Metadata about the charge. Default `undefined`.

- **`sku`** `String`

    The SKU. Should correspond to a key in the [Products Object](packages/flatmarket-schema#products-object). *Required*.

- **`token`** `String`

    The Stripe token. *Required*.

## License

See [LICENSE](https://github.com/christophercliff/flatmarket/blob/master/LICENSE.md).

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