βSDK Setup & Installation
The Fuul Web SDK gives you access to all the functions needed to integrate Fuul into your website β tracking referrals, displaying leaderboards, managing affiliate codes, claiming rewards, and more.
1. Install the SDK
npm install @fuul/sdk# or using yarn
yarn add @fuul/sdk2. Initialize
Before using any SDK method, initialize it with your API key at the root of your app:
import { Fuul } from '@fuul/sdk';
Fuul.init({ apiKey: 'your-api-key' });When using Next.js App Router, initialize the SDK in a client-rendered component ('use client').
Which API key should I use?
The API key you pass to Fuul.init() depends on what your app needs to do:
Display leaderboards, rewards, or user data
read-only
Track pageviews and wallet connections (frontend)
send:tracking_event
Send custom trigger events (backend only)
send:trigger_event
Manage audiences programmatically (backend only)
service_role
What's next?
After initializing the SDK, the typical integration steps are:
Track referral visits and wallet connections
Let users create affiliate links or codes
Display leaderboard rankings
Show individual user rewards
Build a claiming page for onchain rewards
Last updated