π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) andsend:trigger_event(backend)
Step 1: Install and initialize
npm install @fuul/sdkimport { Fuul, UserIdentifierType } 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: UserIdentifierType.EvmAddress,
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:
See Sending Custom Events for batch events and advanced options.
Step 4: Display the points leaderboard
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.
Next steps
Add badges for milestones
Create tiered rewards
Target user segments
Group points by conversion
Add referrals to earn bonus points
Last updated