NodeJS BrightLocal API
A basic NodeJS wrapper to make using the BrightLocal API a little easier. It takes care of authentication so you just need to specify which method you want to call and pass parameters. Based on BrightLocal PHP wrapper.
Installation
npm i -S bright-local-api
Examples
You need to export Api
and V4
(for batch requests) classes at first.
// ES5var BrightLocal = ;var Api = BrightLocalApi;var BatchApiV4 = BrightLocalV4;
// ES6;
const api = API_KEY API_SECRET; // create a clientapi; // also you can writeapi;
The same thing you can do with other methods like put
, get
and delete
.
*note
Api#call
,Api#get
,Api#post
,Api#put
,Api#delete
returns a Promise.
If you want to make a batch request:
const batchApi = api; batchApi ;
For more details visit BrightLocal API Documentation page.