Migrating from 1.x to 2.x version

This guide shows how to migrate from 1.x to 2.x versions of the Fuul Web SDK

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 this guide.

3. Change the sendConnectWallet method name

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

For more information on sending this event, check out this guide.

Last updated