@fuul/sdk
TypeScript icon, indicating that this package has built-in type declarations

7.0.3 • Public • Published

Getting started with Fuul SDK

Installation & minimum set up

1. Installation

Run one of the following commands to add Fuul SDK to your project:

Npm:

npm install @fuul/sdk

Yarn:

yarn add @fuul/sdk

2. Set up

Before using the SDK you must initialize it by supplying your Fuul issued API key.

NOTE: Be sure to do this at the root of your app so you have the SDK ready for use just by importing it at the usage point.

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

Fuul.init({ apiKey: "your-fuul-api-key" });

Now you can start sending events.

3. Sending events

For Fuul to attribute conversion events you'll need to report the following tracking events

Page view event

Projects must send this event every time a user visits a page on their website.

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

await Fuul.sendPageview();

Identify user

Projects must send this event every time users connect a wallet to their website.

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

await Fuul.identifyUser({
  userIdentifier: "0xe06099DbbF626892397f9A74C7f42F16748292Db",
  identifierType: UserIdentifierType.EvmAddress,
  signature: "0xb823038d78e541470946e5125b74878c226a84f891671946f18fbe7e5995171731b92f569c3e83f1c9fb89c5351245494c5d2ce6273f74c853a2cace6073f09c1c",
  message: "Connect wallet"
});

NOTE: Make sure to send the event when connecting a wallet for the first time as well as when changing wallets during the session.

Package Sidebar

Install

npm i @fuul/sdk

Weekly Downloads

1,684

Version

7.0.3

License

MIT

Unpacked Size

166 kB

Total Files

37

Last publish

Collaborators

  • andrebrener
  • nicolasgarnil-fuul
  • alebecher
  • alejoviola