# @busmarket/bmapi-js

> BmApiJS | BusMarket API JS client

Latest version **1.0.8** (published 2020-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @busmarket/bmapi-js
pnpm add @busmarket/bmapi-js
yarn add @busmarket/bmapi-js
bun add @busmarket/bmapi-js
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2020-04-02 |
| First published | 2020-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 233.7 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | Andrew Rymaruk |
| Maintainers | andrey.rymaruk |
| Keywords | api, bmapi, bmapijs, busmarket |

## Links

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

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.19.0

## Recent versions

- 1.0.8 (latest) — 2020-04-02
- 1.0.7 — 2020-04-02
- 1.0.6 — 2020-04-02
- 1.0.5 — 2020-04-02
- 1.0.4 — 2020-04-02

## README

![](https://login.bm.parts/static/img/bm_logo_.svg)

# BusMarket API JS client


### Installation
```
npm i @busmarket/bmapi-js
```

```
You can find a full list of examples here.
https://developer.bm.parts/
```

### Overview

Using JavaScript:

```js
const BmApi = require('@busmarket/bmapi-js');
const myBmApi = new BmApi('<your_token>');
```

Using TypeScript:

```typescript
import BmApi = require("@busmarket/bmapi-js");
const myBmApi = BmApi('<your_token>');
```

### Engine
Every resource method returns a promise.
For example, let's get list of products:

```js
const BmApi = require('@busmarket/bmapi-js');
const myBmApi = new BmApi('<your_token>');
(async() => {
  const response = await myBmApi.search.products({q: '115906'});
  console.info(response.data);
})();
```

### Browser
Also, you can use CDN. Following code bellow:

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="node_modules/@busmarket/bmapi-js/dist/cdn.bmapi.js"></script>
    <script>
      const MyBmApi = new BmApi(`<YOUR_BMAPI_TOKEN>`);
      ( async function() {
          const QueryResponse = await MyBmApi.aggregations.brands({q: '115906'});
          console.info(QueryResponse.data);
      })();
    </script>
</body>
</html>
```

### Documentation

Documentation is available at https://developer.bm.parts

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