🌟Points Program with Leaderboard

Build a points-based loyalty program where users earn points for actions β€” with a leaderboard and per-user rewards view.

Prerequisites

  • A Fuul account with a project created

  • Conversion events configured with point-based payouts

  • API keys: send:tracking_event (frontend) and send:trigger_event (backend)

Step 1: Install and initialize

npm install @fuul/sdk
import { Fuul } from '@fuul/sdk';

Fuul.init({ apiKey: 'your-send-tracking-event-key' });

Step 2: Track users

Set up pageview tracking and wallet identification so Fuul can attribute points to the right users:

// On every page load
await Fuul.sendPageview();

// On wallet connect
await Fuul.identifyUser({
  identifier: address,
  identifierType: 'evm_address',
  signature,
  message: 'Sign to verify your identity',
});

See Tracking Referrals for full details.

Step 3: Send custom events from your backend

When a user completes an action that should earn points, send an event from your backend:

cURL equivalent:

triangle-exclamation

See Sending Custom Events for batch events and advanced options.

Step 4: Display the points leaderboard

circle-info

Leaderboard responses are paginated. Use page and page_size (max 100) to retrieve the full list.

Step 5: Show a user's points

Step 6: Show points history

Display a breakdown of how the user earned their points:

Each movement includes the amount, conversion name, and timestamp. For points, payout_status is always confirmed since no onchain transaction is needed.

circle-info

Rewards data is updated hourly. Recent conversions and payouts appear within a maximum of one hour.

Next steps

Feature
Guide

Add badges for milestones

Create tiered rewards

Target user segments

Group points by conversion

Add referrals to earn bonus points

Last updated