1.0.8 • Published 4 years ago

@busmarket/bmapi-js v1.0.8

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

npm.io

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:

const BmApi = require('@busmarket/bmapi-js');
const myBmApi = new BmApi('<your_token>');

Using 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:

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:

<!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

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago