Use cases

  1. Loyalty Program - Reward users for their continued engagement and loyalty. Users earn experience points (XP) for actions such as logging in daily, making purchases, or referring friends.
  2. Achievement System - Implement an achievement system where users earn XP for completing specific milestones or challenges within your application.
  3. Event Participation - Award XP to users for participating in special events, contests, or promotions.

Video Setup

Prerequisites

  1. Setup OPENFORMAT

    Before you can continue, please complete the following steps to obtain the necessary credentials:

    1. Go to the OPENFORMAT Dashboard
    2. Register for an account
    3. Generate an API Key
    4. Create a dApp
    5. Create a Badge (only if required)
  2. Supabase Table

Create a Supabase table for storing generated web3 accounts for a given user_id. Follow the table structure below. You will need to add the following columns: account_address, private_key and user_id.

Disable Row Level Security (RLS) for testing purposes only. We highly recommend enabling RLS in any production environment to ensure data security and integrity.

New Table

Get Started

1

Remix this template

Clone this template in BuildShip.

2

Supabase Node Inputs

Add your Supabase API Key and API URL to the Get Row and Create Row node inputs.

3

OPENFORMAT Node Inputs

Add your OPENFORMAT API Key, dApp ID and Private Key into the Reward XP Node inputs.

4

Test Integration

To test the integration, click on Test and add the user_id of your user to the body of the request. e.g.

{
  "user_id": "56ba8d26-1137-42a1-a5a8-88066b583f56"
}
5

Generate a Leaderboard

Now that you’ve rewarded XP to a user, you can generate a leaderboard using the Leaderboard Template.

Node Inputs

Reward XP

KeyDescription
API KeyYour OPENFORMAT API Key. You can find this in the Settings page of the Dashboard (String)
dApp IDThe ID of your OPENFORMAT dApp. You can get this in the Dashboard (String, max 32 characters)
Private KeyThe Private Key of your web3 account. You can find this in the Settings page of the Dashboard.
Action IDA random identifier for the action that has been completed, e.g., completed_workout, completed_lesson. (String, max 32 characters)
Amount of XPThe amount of XP to be rewarded. (Number, whole number only)
ReceiverThe address of the receiver, which will be the existing web3 account or the newly generated account.
AwaitWait for the transaction to be confirmed on the blockchain. (Boolean, default: true)