Fuul
  • INTRO
    • ⚑What is Fuul?
    • πŸ’ͺWhy use Fuul?
    • πŸ€”Use Cases
    • βš™οΈIntegration
    • πŸ”—Main Links
  • HOW IT WORKS
    • πŸ’ΈTypes of Rewards
    • βœ…Conversion Events
      • 1️⃣CLAMM LPs (e.g. Uniswap V3)
      • 2️⃣Constant LPs (e.g., Uniswap V2)
      • 3️⃣Lending & Borrowing
      • 4️⃣Staking
      • 5️⃣Token Holders
      • 6️⃣Custom Onchain Events
      • 7️⃣Custom Offchain Events
  • πŸ€‘Incentive Payouts
    • πŸ—ΏFixed Rewards
    • 🌊Variable Rewards
    • πŸ’°Pool Distribution
  • πŸ§‘β€πŸ€β€πŸ§‘Referrals
  • ♾️Attribution Methods
  • πŸ’²Budgets
  • ⚑Fuul Incentives Manager
  • πŸŽ–οΈLeaderboards
  • πŸ’»Incentives Hub
    • πŸ‘¨β€πŸ’»White-Label Implementation
    • πŸ‘No-Code
  • FOR DEVS
    • ⭐Getting started with Fuul Web SDK
    • βš™οΈSending Custom Events through the API
    • πŸ“„Tracking referrals in your app
    • πŸ‘¨β€πŸ’»API Key Management
    • πŸ› οΈBuilding your incentives hub in your app (white-label)
      • ℹ️Getting all incentives information
      • πŸ”—Creating affiliate links or codes
      • πŸ’―Getting Leaderboard Data
        • πŸͺ™Tokens
        • 🌟Points
      • πŸ™‹Getting Individual Rewards
        • πŸͺ™Tokens
        • 🌟Points
      • πŸ€™Claiming Onchain Rewards
    • πŸ”§Building widgets
    • πŸ“’Managing Audiences and Segments
      • πŸ‘€Getting User Audiences using Fuul SDK
      • πŸ‘₯Updating Audience Segments using Fuul API
    • ✈️Migration from older SDK versions
    • πŸ†˜Troubleshooting
  • PROTOCOL
    • ⛓️Smart Contracts
    • 🧡Subgraphs
  • Guides
    • ✏️Getting Started
      • Creating Your First Incentive Program
      • How to Add a Budget in Fuul
  • 🏁Creating Triggers & Conversions
    • Understanding Triggers Types
    • Creating an Event with CSV file
  • 🎨Program Incentive Page
    • Building no code landing pages
  • πŸ“ŠAnalytics
    • Understanding Sybil Detection
Powered by GitBook
On this page
  • Migrating from 1.x to 2.x version
  • Migrating from 2.x to 3.x version
  1. FOR DEVS

Migration from older SDK versions

This guide will show you how to migrate from older versions.

PreviousUpdating Audience Segments using Fuul APINextTroubleshooting

Last updated 4 months ago

Migrating from 1.x to 2.x version

To migrate from 1.x to 2.x versions please follow this guide:

1. Initializing the object

v1.x

import Fuul from '@fuul/sdk';
const fuul = new Fuul('your-api-key');

v2.x

import { Fuul } from '@fuul/sdk';
Fuul.init({ apiKey: 'your-api-key' });

Initialization is good for the entire request lifecycle so doing it at the root of your app is probably best.

For usage in any other modules, you just import Fuul and use it like this:

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

Fuul.sendPageview();

2. Start sending Pageview events manually

The most important upgrade relies on the pageview event. In SDK v1.x, pageview events were sent automatically when instancing the object. That led to some confusion as it was not very explicit.

Now on v2, pageview events have to be sent manually when the page is rendered. Please check how to send this event in .

3. Change the sendConnectWallet method name

On v1, the method was called sendConnectWalletEvent, now it was changed to sendConnectWallet.

Migrating from 2.x to 3.x version

There is only a minor breaking change when upgrading the Fuul SDK to the 3.x versions:

1. Getting the affiliate tracking links

The generateTrackingLink method now returns a Promise<string> instead of a string. It now also accounts for affiliate codes created by the affiliateAddress argument.

v1.x/v2.x

import { Fuul } from ('@fuul/sdk');

const trackingLinkUrl = Fuul.generateTrackingLink(
    baseURL, affiliateAddress)

// Returns
"http://yourwebsite.com?af=<affiliateAddress>"

v3.x

import { Fuul } from ('@fuul/sdk');

const trackingLinkUrl = await Fuul.generateTrackingLink(
    baseURL, affiliateAddress)

// Returns
"http://yourwebsite.com?af=<affiliateAddressOrCode>"

For more information on sending this event, check out .

For more information on getting the affiliate link, check out

✈️
this guide
this guide.
this guide