@inboundlabs/booya-api-client
v0.1.4
Published
Node.js Client Library for Booya 2.0 API
Downloads
13
Readme
Booya API Client
Node.js Client Library for Booya 2.0 API
Installation
# npm
npm install --save @inboundlabs/booya-api-client
# yarn
yarn add @inboundlabs/booya-api-client
Initialize API Client
const BooyaClient = require('@inboundlabs/booya-api-client');
// Initialize
const appId = 'inboundlabs'; // Replace with your appId from https://go.booya.io
const booyaClient = new BooyaClient(appId);
Usage
Verify Token
const token = '<user token here>'; // Replace with code to retrieve token e.g from request body or headers
booyaClient.verify(token).then(response => {
const user = response.user;
// Do authenticated stuff
}).catch(err => {
console.error('error => ', err);
// Handle authentication error
});