bvckup2
v0.0.2
Published
Unofficial library to work with the Bvcup2 API
Downloads
3
Readme
node-bvckup2
A simple module for using the Bvckup2 Dashboard API.
Install using npm install --save bvckup2
or clone the repo
Examples
Init the object
const Bvckup2 = require('bvckup2');
// You should change this to your real API key
// or use environment variable BVCKUP2_API_KEY
const apiKey = 'api_secret_000011112222';
const bvckup2 = new Bvckup2(process.env.BVCKUP2_API_KEY || apiKey);
List all licenses
bvckup2.listAllLicenses({}, (err, licenses) => {
if (err) return console.error('Error',err);
console.log('Found',licenses.length,'licenses!');
console.log(licenses);
});
Get a specific license
const licenseId = 'ABCD-1234-5678-9123';
bvckup2.getLicense(licenseId, (err, licenseInfo) => {
if (err) return console.error('Error',err);
console.log('Got License Info', licenseInfo);
});
Also supports promises!
const licenseId = 'ABCD-1234-5678-9123';
bvckup2.getLicenseAsync(licenseId).then((licenseInfo) => {
console.log('Got License Info', licenseInfo);
}).error((err) => {
console.error('Error',err);
});