@fuul/sdk 0.17.0 → 1.0.0

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.
Files changed (64) hide show
  1. package/README.md +21 -26
  2. package/dist/constants.d.ts.map +1 -0
  3. package/dist/fuul-sdk.mjs +1569 -0
  4. package/dist/fuul-sdk.umd.js +3 -0
  5. package/dist/index.d.ts +36 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/{lib/cjs/types → dist}/infrastructure/conversions/conversionService.d.ts +2 -2
  8. package/dist/infrastructure/conversions/conversionService.d.ts.map +1 -0
  9. package/{lib/cjs/types → dist}/infrastructure/conversions/dtos.d.ts +4 -0
  10. package/dist/infrastructure/conversions/dtos.d.ts.map +1 -0
  11. package/{lib/cjs/types → dist}/infrastructure/http/HttpClient.d.ts +1 -1
  12. package/dist/infrastructure/http/HttpClient.d.ts.map +1 -0
  13. package/dist/types/index.d.ts +37 -0
  14. package/dist/types/index.d.ts.map +1 -0
  15. package/dist/utils/events.d.ts +4 -0
  16. package/dist/utils/events.d.ts.map +1 -0
  17. package/{lib/cjs/types → dist}/utils/localStorage.d.ts +5 -0
  18. package/dist/utils/localStorage.d.ts.map +1 -0
  19. package/dist/utils/queryParams.d.ts.map +1 -0
  20. package/package.json +55 -17
  21. package/lib/cjs/constants.js +0 -15
  22. package/lib/cjs/index.js +0 -247
  23. package/lib/cjs/infrastructure/conversions/conversionService.js +0 -24
  24. package/lib/cjs/infrastructure/conversions/dtos.js +0 -2
  25. package/lib/cjs/infrastructure/http/HttpClient.js +0 -51
  26. package/lib/cjs/types/constants.d.ts.map +0 -1
  27. package/lib/cjs/types/index.d.ts +0 -46
  28. package/lib/cjs/types/index.d.ts.map +0 -1
  29. package/lib/cjs/types/index.js +0 -2
  30. package/lib/cjs/types/infrastructure/conversions/conversionService.d.ts.map +0 -1
  31. package/lib/cjs/types/infrastructure/conversions/dtos.d.ts.map +0 -1
  32. package/lib/cjs/types/infrastructure/http/HttpClient.d.ts.map +0 -1
  33. package/lib/cjs/types/types/index.d.ts +0 -27
  34. package/lib/cjs/types/types/index.d.ts.map +0 -1
  35. package/lib/cjs/types/utils/localStorage.d.ts.map +0 -1
  36. package/lib/cjs/types/utils/queryParams.d.ts.map +0 -1
  37. package/lib/cjs/utils/localStorage.js +0 -20
  38. package/lib/cjs/utils/queryParams.js +0 -14
  39. package/lib/esm/constants.js +0 -12
  40. package/lib/esm/index.mjs +0 -243
  41. package/lib/esm/infrastructure/conversions/conversionService.js +0 -20
  42. package/lib/esm/infrastructure/conversions/dtos.js +0 -1
  43. package/lib/esm/infrastructure/http/HttpClient.js +0 -44
  44. package/lib/esm/types/constants.d.ts +0 -13
  45. package/lib/esm/types/constants.d.ts.map +0 -1
  46. package/lib/esm/types/index.d.ts +0 -46
  47. package/lib/esm/types/index.d.ts.map +0 -1
  48. package/lib/esm/types/index.js +0 -1
  49. package/lib/esm/types/infrastructure/conversions/conversionService.d.ts +0 -8
  50. package/lib/esm/types/infrastructure/conversions/conversionService.d.ts.map +0 -1
  51. package/lib/esm/types/infrastructure/conversions/dtos.d.ts +0 -33
  52. package/lib/esm/types/infrastructure/conversions/dtos.d.ts.map +0 -1
  53. package/lib/esm/types/infrastructure/http/HttpClient.d.ts +0 -27
  54. package/lib/esm/types/infrastructure/http/HttpClient.d.ts.map +0 -1
  55. package/lib/esm/types/types/index.d.ts +0 -27
  56. package/lib/esm/types/types/index.d.ts.map +0 -1
  57. package/lib/esm/types/utils/localStorage.d.ts +0 -9
  58. package/lib/esm/types/utils/localStorage.d.ts.map +0 -1
  59. package/lib/esm/types/utils/queryParams.d.ts +0 -2
  60. package/lib/esm/types/utils/queryParams.d.ts.map +0 -1
  61. package/lib/esm/utils/localStorage.js +0 -9
  62. package/lib/esm/utils/queryParams.js +0 -10
  63. /package/{lib/cjs/types → dist}/constants.d.ts +0 -0
  64. /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
- **Setting up the Fuul SDK**
3
+ ## Installation
4
4
 
5
- ## 1. Install the Fuul SDK
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
- ### npm
9
+ Npm:
10
10
 
11
11
  ```bash
12
12
  npm install @fuul/sdk
13
13
  ```
14
14
 
15
- ### yarn
15
+ Yarn:
16
16
 
17
17
  ```bash
18
18
  yarn add @fuul/sdk
19
19
  ```
20
20
 
21
- ## 2. Set up the Fuul SDK
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
- ## 3. Test your integration
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
- ## 4. Sending events
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
- ### Connect wallet event
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 Fuul.sendEvent("connect_wallet", {
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 custom events (optional)
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("myCustomEvent", {
70
- foo,
71
- bar,
72
- ...myWonderfulArguments
64
+ ```tsx
65
+ await fuul.sendEvent("my-custom-event", {
66
+ arg1: 'arg1',
67
+ arg2: 'arg2',
73
68
  });
74
69
  ```
75
70
 
76
- ## 5. Generating tracking links
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"}