Node Inputs
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 thecomplete_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:
-
First Mission:
complete_first_run- Requirements: The user must complete their first run (
complete_runaction) 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_runaction) 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_runaction) 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 (
Currently, the mission
name must match the name of the rewarded
badge in the mission configuration above.Node Outputs
| Key | Description |
|---|---|
completedMissions | A list of missions that have been completed (i.e the badge has been rewarded to the user). Each mission includes name, xp_reward_amount, and badge_reward_id. |
pendingMissions | A list of missions that are pending completion. Each mission includes name, xp_reward_amount, and badge_reward_id. |
uncompletedMissions | A list of missions that have not been completed. Each mission includes: |
uncompletedMissions.name | The name of the uncompleted mission. |
uncompletedMissions.progressInPercent | The progress of the mission in percent. |
uncompletedMissions.remainingActions | A list of actions that need to be completed to finish the mission. Each action includes: |
uncompletedMissions.remainingActions.name | The name of the action that needs to be completed. |
uncompletedMissions.remainingActions.remainingCount | The remaining count of the action that needs to be completed. |