bountyblok
v1.0.5
Published
Node.js client library for using bountyblok's APIs to log challenge tasks and retrieve progress and achievements.
Downloads
6
Maintainers
Readme
This library allows you to easily use the bountyblok.io APIs via Node.js.
bountyblok.io is a gamification engine built and powered by the EOS blockchain.
This library is a quick and easy way to Log tasks for challenges as well as retrieve progresses/badges/achievements and more. We will keep updating this library to expose our API calls in the future!
Thanks for your support!
Installation
Prerequisites
- Node.js version 6, 7 or 8
Obtain an API Key
Grab your API Key from the bountyblok.io UI.
Install Package
The following recommended installation requires npm. If you are unfamiliar with npm, see the npm docs. Npm comes installed with Node.js since node version 0.8.x, therefore, you likely already have it.
npm install --save bountyblok
You may also use yarn to install.
yarn add bountyblok
Examples
const client = require('bountyblok')
const {
classes: {
GetChallengeRequest,
GetLevelsRequest,
LogAppRequest
}
} = require('bountyblok')
/v1/log_app
const request = new LogAppRequest({
appId: '<< app_id >>',
accountName: 'user123',
quantity: 1,
param:{
orderside: 'sell',
ordertype: 'mkt',
exchange: 'us'
}
})
client.logAppAsync(request).then((res) => console.log(res) )
/v1/get_all_levels_progress
const request = new GetLevelsRequest({
appId: '<< app_id >>',
accountName: 'user123'
})
client.getAllLevelsProgressAsync(request).then((res)=>{
// returns GetLevelsResponse
console.log(res.levels[0].challenges[0].tasks[0].taskName)
console.log(res.levels[0].challenges[0].tasks[0].quantityRequired)
})