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!
- Node.js version 6, 7 or 8
Grab your API Key from the bountyblok.io UI.
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
const client = require('bountyblok')
const {
classes: {
GetChallengeRequest,
GetLevelsRequest,
LogAppRequest
}
} = require('bountyblok')
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) )
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)
})