@fuul/sdk 0.18.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -26
- package/dist/constants.d.ts.map +1 -0
- package/dist/fuul-sdk.mjs +1569 -0
- package/dist/fuul-sdk.umd.js +3 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/{lib/cjs/types → dist}/infrastructure/conversions/conversionService.d.ts +2 -2
- package/dist/infrastructure/conversions/conversionService.d.ts.map +1 -0
- package/dist/infrastructure/conversions/dtos.d.ts +77 -0
- package/dist/infrastructure/conversions/dtos.d.ts.map +1 -0
- package/{lib/cjs/types → dist}/infrastructure/http/HttpClient.d.ts +1 -1
- package/dist/infrastructure/http/HttpClient.d.ts.map +1 -0
- package/dist/types/index.d.ts +37 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/events.d.ts +4 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/{lib/cjs/types → dist}/utils/localStorage.d.ts +5 -0
- package/dist/utils/localStorage.d.ts.map +1 -0
- package/dist/utils/queryParams.d.ts.map +1 -0
- package/package.json +55 -17
- package/lib/cjs/constants.js +0 -15
- package/lib/cjs/index.js +0 -247
- package/lib/cjs/infrastructure/conversions/conversionService.js +0 -24
- package/lib/cjs/infrastructure/conversions/dtos.js +0 -2
- package/lib/cjs/infrastructure/http/HttpClient.js +0 -51
- package/lib/cjs/types/constants.d.ts.map +0 -1
- package/lib/cjs/types/index.d.ts +0 -46
- package/lib/cjs/types/index.d.ts.map +0 -1
- package/lib/cjs/types/index.js +0 -2
- package/lib/cjs/types/infrastructure/conversions/conversionService.d.ts.map +0 -1
- package/lib/cjs/types/infrastructure/conversions/dtos.d.ts +0 -37
- package/lib/cjs/types/infrastructure/conversions/dtos.d.ts.map +0 -1
- package/lib/cjs/types/infrastructure/http/HttpClient.d.ts.map +0 -1
- package/lib/cjs/types/types/index.d.ts +0 -27
- package/lib/cjs/types/types/index.d.ts.map +0 -1
- package/lib/cjs/types/utils/localStorage.d.ts.map +0 -1
- package/lib/cjs/types/utils/queryParams.d.ts.map +0 -1
- package/lib/cjs/utils/localStorage.js +0 -20
- package/lib/cjs/utils/queryParams.js +0 -14
- package/lib/esm/constants.js +0 -12
- package/lib/esm/index.mjs +0 -243
- package/lib/esm/infrastructure/conversions/conversionService.js +0 -20
- package/lib/esm/infrastructure/conversions/dtos.js +0 -1
- package/lib/esm/infrastructure/http/HttpClient.js +0 -44
- package/lib/esm/types/constants.d.ts +0 -13
- package/lib/esm/types/constants.d.ts.map +0 -1
- package/lib/esm/types/index.d.ts +0 -46
- package/lib/esm/types/index.d.ts.map +0 -1
- package/lib/esm/types/index.js +0 -1
- package/lib/esm/types/infrastructure/conversions/conversionService.d.ts +0 -8
- package/lib/esm/types/infrastructure/conversions/conversionService.d.ts.map +0 -1
- package/lib/esm/types/infrastructure/conversions/dtos.d.ts +0 -37
- package/lib/esm/types/infrastructure/conversions/dtos.d.ts.map +0 -1
- package/lib/esm/types/infrastructure/http/HttpClient.d.ts +0 -27
- package/lib/esm/types/infrastructure/http/HttpClient.d.ts.map +0 -1
- package/lib/esm/types/types/index.d.ts +0 -27
- package/lib/esm/types/types/index.d.ts.map +0 -1
- package/lib/esm/types/utils/localStorage.d.ts +0 -9
- package/lib/esm/types/utils/localStorage.d.ts.map +0 -1
- package/lib/esm/types/utils/queryParams.d.ts +0 -2
- package/lib/esm/types/utils/queryParams.d.ts.map +0 -1
- package/lib/esm/utils/localStorage.js +0 -9
- package/lib/esm/utils/queryParams.js +0 -10
- /package/{lib/cjs/types → dist}/constants.d.ts +0 -0
- /package/{lib/cjs/types → dist}/utils/queryParams.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
# Getting started with Fuul SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Installation
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### 1. Install the Fuul SDK
|
|
6
6
|
|
|
7
7
|
Run one of the following commands to add Fuul SDK to your project:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Npm:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install @fuul/sdk
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Yarn:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
yarn add @fuul/sdk
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### 2. Set up the Fuul SDK
|
|
22
22
|
|
|
23
23
|
In order to authenticate to Fuul with your project, you must execute the following in the root file of your app.
|
|
24
24
|
|
|
25
|
-
```
|
|
26
|
-
// App.tsx
|
|
27
|
-
|
|
28
|
-
// Settings config object
|
|
25
|
+
```tsx
|
|
29
26
|
const settings = {
|
|
30
27
|
apiKey: "your-fuul-api-key"
|
|
31
28
|
};
|
|
@@ -35,45 +32,43 @@ const fuul = new Fuul(settings);
|
|
|
35
32
|
|
|
36
33
|
Now you’ll be able to use Fuul as a global object in any of your files, so you don’t have to create a new instance every time.
|
|
37
34
|
|
|
38
|
-
|
|
35
|
+
### 3. Test your integration
|
|
39
36
|
|
|
40
37
|
Test your integration with the following method:
|
|
41
38
|
|
|
42
|
-
```
|
|
39
|
+
```tsx
|
|
43
40
|
function main() {
|
|
44
41
|
fuul.verifyConnection();
|
|
45
42
|
}
|
|
46
43
|
main();
|
|
47
44
|
```
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
### 4. Sending events
|
|
50
47
|
|
|
51
48
|
For Fuul to attribute conversion events to your visitors, you'll need to report the connect_wallet event.
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
#### Connect wallet event
|
|
51
|
+
|
|
54
52
|
Projects must send this event every time users connect a wallet to their website (both when connecting a wallet for the first time and when changing wallets during the session).
|
|
53
|
+
|
|
55
54
|
For this type of event, projects must send the user address that is being connected to the website as an argument.
|
|
56
55
|
|
|
57
|
-
```
|
|
58
|
-
await
|
|
59
|
-
address: <address>,
|
|
60
|
-
signing_message: <message>,
|
|
61
|
-
signature: <signature>
|
|
62
|
-
});
|
|
56
|
+
```tsx
|
|
57
|
+
await fuul.sendEvent("connect_wallet", {}, { userAddress: '0x01' });
|
|
63
58
|
```
|
|
64
59
|
|
|
65
|
-
### Sending
|
|
60
|
+
### Sending Custom Events
|
|
61
|
+
|
|
66
62
|
Apart from the necessary `connect wallet` event, we allow projects to send any custom event to track as pleased.
|
|
67
63
|
|
|
68
|
-
```
|
|
69
|
-
await fuul.sendEvent("
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
...myWonderfulArguments
|
|
64
|
+
```tsx
|
|
65
|
+
await fuul.sendEvent("my-custom-event", {
|
|
66
|
+
arg1: 'arg1',
|
|
67
|
+
arg2: 'arg2',
|
|
73
68
|
});
|
|
74
69
|
```
|
|
75
70
|
|
|
76
|
-
|
|
71
|
+
### 5. Generating Tracking Links
|
|
77
72
|
|
|
78
73
|
You can also generate the tracking link for a given wallet `address` and `project id`
|
|
79
74
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AACtD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,kBAAkB,4BAA4B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,eAAO,MAAM,6BAA6B,QAAQ,CAAC;AAEnD,eAAO,MAAM,kBAAkB,UAA0C,CAAC"}
|