Check and Reward Missions
Checks whether a user has completed all the actions that make up a mission, and if they have, it rewards them with the appropriate XP and badges.
Use cases
- Language Learning Apps: Reward users with XP and badges for completing levels or reaching streak milestones, granting them access to exclusive levels.
- Corporate Training: Automatically reward employees with certificates or badges after completing required training modules, aiding in progress tracking and compliance.
- Music Learning Platforms: Reward students with badges for completing lessons or practice hours, granting them access to feedback sessions with professional musicians or exclusive performance opportunities.
- Gaming Platforms: Reward players with XP or unlockable content for completing in-game missions or challenges, recognizing achievements and encouraging continued gameplay.
- Educational Institutions & Digital CVs: Reward students for completing both in-person and online education, providing badges that verify their micro-learning achievements.
Video Setup
Prerequisites
-
Setup OPENFORMAT
Before you can continue, please complete the following steps to obtain the necessary credentials:
- Go to the OPENFORMAT Dashboard
- Register for an account
- Generate an API Key
- Create a dApp
- Create a Badge (only if required)
Get Started
A step-by-step breakdown of how this template works.
Remix this template
Clone this template in BuildShip.
OPENFORMAT Node Inputs
Add your OPENFORMAT API Key
and Private Key
into the Check
missions, Reward XP and Reward Badge node inputs.
Test Integration
To test the integration, click on Test and add the dAppId
and userId
of your user to the body of the request. e.g.
Node Inputs
Check Missions
Key | Description |
---|---|
API Key | Your OPENFORMAT API Key. which can be created in the Dashboard. |
dApp ID | The ID for your OPENFORMAT dApp, you can create a dApp in the OPENFORMAT Dashboard. |
User ID | The address of the user, which will be their existing web3 account address. |
Missions | The list of missions to check for. |
Missions Example
My example app is designed to help users run their first 10km by completing 1km runs.
Each time a user completes a 1km run, we use the Reward XP node to complete the complete_run
action.
Once they complete the complete_run
action a specific amount of times, they will complete a mission. We use the following mission configuration:
In this configuration:
-
First Mission:
complete_first_run
- Requirements: The user must complete their first run (
complete_run
action) once. - Rewards: Upon completion, the user earns 100 XP and receives a badge identified by
BADGE_ID_FIRST_RUN
.
- Requirements: The user must complete their first run (
-
Second Mission:
run_5k
- Requirements: The user must complete five runs (
complete_run
action) in total. - Rewards: Upon completion, the user earns 200 XP and receives a badge identified by
BADGE_ID_RUN_5K
.
- Requirements: The user must complete five runs (
-
Third Mission:
run_10k
- Requirements: The user must complete ten runs (
complete_run
action) in total. - Rewards: Upon completion, the user earns 1000 XP and receives a badge identified by
BADGE_ID_RUN_10K
.
- Requirements: The user must complete ten runs (
Reward XP
Key | Description |
---|---|
API Key | Your OPENFORMAT API Key. You can find this in the Settings page of the Dashboard (String) |
dApp ID | The ID of your OPENFORMAT dApp. You can get this in the Dashboard (String, max 32 characters) |
Private Key | The Private Key of your web3 account. You can find this in the Settings page of the Dashboard. |
Action ID | A random identifier for the action that has been completed, e.g., completed_workout , completed_lesson . (String, max 32 characters) |
Amount of XP | The amount of XP to be rewarded. (Number, whole number only) |
Receiver | The address of the receiver, which will be the existing web3 account or the newly generated account. |
Await | Wait for the transaction to be confirmed on the blockchain. (Boolean, default: true) |
Reward Badge
Key | Description |
---|---|
API Key | Your OPENFORMAT API Key. You can find this in the Settings page of the Dashboard (String) |
dApp ID | The ID of your OPENFORMAT dApp. You can get this in the Dashboard (String, max 32 characters) |
Private Key | The Private Key of your web3 account. You can find this in the Settings page of the Dashboard. |
Badge Name | The name of the badge that you are awarding, this must exactly match the name of the badge created. You can create a badge in the Dashboard. (string) |
Receiver | The address of the receiver, which will be the existing web3 account or the newly generated account. |
Await | Wait for the transaction to be confirmed on the blockchain. (Boolean, default: true) |
Gotchas and Troubleshooting
- If you encounter issues, ensure all required fields are correctly filled and check your API and Private Key configurations in the Dashboard settings.
- For custom name and image configurations for anonymous users, edit the
Improve Leaderboard
node with your preferred text and URLs.