Step-by-Step Guide to Enable In-App Actions
Follow this guide to integrate in-app actions to HeyMint Quest!
Last updated
Follow this guide to integrate in-app actions to HeyMint Quest!
Last updated
To enable in-app actions, there are 5 main steps to follow:
Create a HeyMint quest identity for each user.
Associate the identity with your app user and save it in your app.
Associate the HeyMint user with the HeyMint quest identity.
Create events for each in-app action.
Log an event when the action occurs.
We will guide you step by step to ensure the in-app actions function correctly.
To track who completes actions in your app, HeyMint requires a unique identity for each user. You’ll need to create a HeyMint identity and link it to your app’s user account. Add logic to generate a HeyMint identity at a relevant point in your app, usually when handling the login event. You can create the identity by calling the API here.
There are two ways to create an identity:
Create an identity and associate it with your user on your side. If you use this option, proceed to Step 2.
Create an identity using your app's unique identifier (e.g., user ID, wallet address, etc.). Ensure you include uniqueIdentifier
in the request body. This option is for when you don't want to save the HeyMint identifier in your app. If you choose this option, skip Step 2.
If you chose Option 1 in the previous step, you will receive a unique identifier from the API response. Save it in your user object so that you can access the identifier when the user performs actions in your app.
If you chose Option 2, no further action is needed here.
The created identity is not automatically associated with the HeyMint quest user account. To associate the identity with the HeyMint user, you will need to use the frontend window.HMwidget
object, which is available on any page where your quest widget is active. Call window.HMwidget.setIdentity('insert the user’s identifier here')
to link the identifier with the HeyMint account.
The next step is to define the in-app actions. For example, if you want users to visit the dashboard, you can create a "Visit Dashboard" event using the Create Event API.
Once the event is created, you will receive a unique identifier. Be sure to save this identifier, as you will need it when logging the event.
Once the event is created, you can call the Log Event API when the action occurs. For example, if you want to track visits to the dashboard, add the Log Event API call when the dashboard page loads. You will need to send the HeyMint user identifier (either the unique identifier you got from the Create Identity API or the unique identifier you used to create the HeyMint identity) and the event ID to HeyMint in order to log the event.
This final step does not require developer assistance. Once the event has been created, it will appear when you select the "Custom Event" type in a quest. Simply select the event and proceed to create the quest.