@blux.ai/web-sdk 0.0.7 → 1.0.0-rc0

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 (121) hide show
  1. package/README.md +19 -19
  2. package/dist/package.json +35 -0
  3. package/package.json +2 -2
  4. package/demo/src/App.test.tsx +0 -9
  5. package/demo/src/App.tsx +0 -252
  6. package/demo/src/index.css +0 -16
  7. package/demo/src/index.tsx +0 -19
  8. package/demo/src/react-app-env.d.ts +0 -1
  9. package/demo/src/reportWebVitals.ts +0 -15
  10. package/demo/src/setupTests.ts +0 -5
  11. package/dist/BluxClient.d.ts +0 -43
  12. package/dist/BluxClient.js +0 -190
  13. package/dist/BluxClient.js.map +0 -1
  14. package/dist/apis/APIs.d.ts +0 -317
  15. package/dist/apis/APIs.js +0 -138
  16. package/dist/apis/APIs.js.map +0 -1
  17. package/dist/apis/createEvent.d.ts +0 -4
  18. package/dist/apis/createEvent.js +0 -7
  19. package/dist/apis/createEvent.js.map +0 -1
  20. package/dist/apis/getItemRecommendation.d.ts +0 -4
  21. package/dist/apis/getItemRecommendation.js +0 -7
  22. package/dist/apis/getItemRecommendation.js.map +0 -1
  23. package/dist/apis/initialize.d.ts +0 -4
  24. package/dist/apis/initialize.js +0 -7
  25. package/dist/apis/initialize.js.map +0 -1
  26. package/dist/apis/signIn.d.ts +0 -4
  27. package/dist/apis/signIn.js +0 -7
  28. package/dist/apis/signIn.js.map +0 -1
  29. package/dist/apis/signOut.d.ts +0 -4
  30. package/dist/apis/signOut.js +0 -7
  31. package/dist/apis/signOut.js.map +0 -1
  32. package/dist/apis/updateCustomUserProperties.d.ts +0 -4
  33. package/dist/apis/updateCustomUserProperties.js +0 -7
  34. package/dist/apis/updateCustomUserProperties.js.map +0 -1
  35. package/dist/apis/updateUserProperties.d.ts +0 -4
  36. package/dist/apis/updateUserProperties.js +0 -7
  37. package/dist/apis/updateUserProperties.js.map +0 -1
  38. package/dist/constants/COUNTRIES.d.ts +0 -928
  39. package/dist/constants/COUNTRIES.js +0 -1159
  40. package/dist/constants/COUNTRIES.js.map +0 -1
  41. package/dist/constants/ISO8601_REGEX.d.ts +0 -1
  42. package/dist/constants/ISO8601_REGEX.js +0 -4
  43. package/dist/constants/ISO8601_REGEX.js.map +0 -1
  44. package/dist/constants/URLS.d.ts +0 -6
  45. package/dist/constants/URLS.js +0 -7
  46. package/dist/constants/URLS.js.map +0 -1
  47. package/dist/events/AddCartaddEvent.d.ts +0 -5
  48. package/dist/events/AddCartaddEvent.js +0 -11
  49. package/dist/events/AddCartaddEvent.js.map +0 -1
  50. package/dist/events/AddCustomEvent.d.ts +0 -5
  51. package/dist/events/AddCustomEvent.js +0 -12
  52. package/dist/events/AddCustomEvent.js.map +0 -1
  53. package/dist/events/AddLikeEvent.d.ts +0 -5
  54. package/dist/events/AddLikeEvent.js +0 -11
  55. package/dist/events/AddLikeEvent.js.map +0 -1
  56. package/dist/events/AddPageViewEvent.d.ts +0 -5
  57. package/dist/events/AddPageViewEvent.js +0 -11
  58. package/dist/events/AddPageViewEvent.js.map +0 -1
  59. package/dist/events/AddProductDetailViewEvent.d.ts +0 -5
  60. package/dist/events/AddProductDetailViewEvent.js +0 -11
  61. package/dist/events/AddProductDetailViewEvent.js.map +0 -1
  62. package/dist/events/AddPurchaseEvent.d.ts +0 -5
  63. package/dist/events/AddPurchaseEvent.js +0 -12
  64. package/dist/events/AddPurchaseEvent.js.map +0 -1
  65. package/dist/events/AddRateEvent.d.ts +0 -5
  66. package/dist/events/AddRateEvent.js +0 -12
  67. package/dist/events/AddRateEvent.js.map +0 -1
  68. package/dist/events/AddRecommendationViewEvent.d.ts +0 -5
  69. package/dist/events/AddRecommendationViewEvent.js +0 -10
  70. package/dist/events/AddRecommendationViewEvent.js.map +0 -1
  71. package/dist/events/Event.d.ts +0 -16
  72. package/dist/events/Event.js +0 -24
  73. package/dist/events/Event.js.map +0 -1
  74. package/dist/events/VisitEvent.d.ts +0 -5
  75. package/dist/events/VisitEvent.js +0 -10
  76. package/dist/events/VisitEvent.js.map +0 -1
  77. package/dist/events/index.d.ts +0 -8
  78. package/dist/events/index.js +0 -9
  79. package/dist/events/index.js.map +0 -1
  80. package/dist/events/types.d.ts +0 -38
  81. package/dist/events/types.js +0 -2
  82. package/dist/events/types.js.map +0 -1
  83. package/dist/index.d.ts +0 -5
  84. package/dist/index.js +0 -6
  85. package/dist/index.js.map +0 -1
  86. package/dist/recommendations/ItemRecommendation.d.ts +0 -5
  87. package/dist/recommendations/ItemRecommendation.js +0 -12
  88. package/dist/recommendations/ItemRecommendation.js.map +0 -1
  89. package/dist/recommendations/Recommendation.d.ts +0 -5
  90. package/dist/recommendations/Recommendation.js +0 -9
  91. package/dist/recommendations/Recommendation.js.map +0 -1
  92. package/dist/recommendations/index.d.ts +0 -1
  93. package/dist/recommendations/index.js +0 -2
  94. package/dist/recommendations/index.js.map +0 -1
  95. package/dist/recommendations/types.d.ts +0 -11
  96. package/dist/recommendations/types.js +0 -2
  97. package/dist/recommendations/types.js.map +0 -1
  98. package/dist/utils/Base.d.ts +0 -13
  99. package/dist/utils/Base.js +0 -2
  100. package/dist/utils/Base.js.map +0 -1
  101. package/dist/utils/LocalStorage.d.ts +0 -4
  102. package/dist/utils/LocalStorage.js +0 -14
  103. package/dist/utils/LocalStorage.js.map +0 -1
  104. package/dist/utils/Logger.d.ts +0 -13
  105. package/dist/utils/Logger.js +0 -49
  106. package/dist/utils/Logger.js.map +0 -1
  107. package/dist/utils/assertEqualTypes.d.ts +0 -3
  108. package/dist/utils/assertEqualTypes.js +0 -5
  109. package/dist/utils/assertEqualTypes.js.map +0 -1
  110. package/dist/utils/getPath.d.ts +0 -1
  111. package/dist/utils/getPath.js +0 -9
  112. package/dist/utils/getPath.js.map +0 -1
  113. package/dist/utils/helper.d.ts +0 -1
  114. package/dist/utils/helper.js +0 -4
  115. package/dist/utils/helper.js.map +0 -1
  116. package/dist/utils/operators.d.ts +0 -2
  117. package/dist/utils/operators.js +0 -6
  118. package/dist/utils/operators.js.map +0 -1
  119. package/dist/utils/zodSchemas.d.ts +0 -19
  120. package/dist/utils/zodSchemas.js +0 -105
  121. package/dist/utils/zodSchemas.js.map +0 -1
package/README.md CHANGED
@@ -20,11 +20,11 @@ yarn add @blux.ai/web-sdk
20
20
  - 필요 변수 : `클라이언트 ID`, `API 키`
21
21
 
22
22
  ```typescript
23
- BluxClient.setLogLevel("debug");
24
- BluxClient.init({
25
- bluxClientId: "{blux_client_id}",
23
+ const bluxClient = await BluxClient.init({
24
+ applicationId: "{blux_client_id}",
26
25
  bluxApiKey: "{blux_api_key}",
27
26
  });
27
+ bluxClient.setLogLevel("debug");
28
28
  ```
29
29
 
30
30
  - **setLogLevel** : 연동 관련하여 디버깅을 하기 위해서 로깅을 활성화할 수 있습니다. 해당 설정은 정적이므로 BluxClient를 초기화하기 전에 호출하실 수 있습니다.
@@ -42,7 +42,7 @@ BluxClient.init({
42
42
  - 회원 유저가 앱을 실행하는 시점에도 `initialize` 메소드 호출 이후에 실행되어야 합니다.
43
43
 
44
44
  ```typescript
45
- BluxClient.signIn("USER ID");
45
+ bluxClient.signIn("USER ID");
46
46
  ```
47
47
 
48
48
  ### setUserProperties
@@ -50,8 +50,8 @@ BluxClient.signIn("USER ID");
50
50
  - 유저에게 지정된 속성들을 부여합니다. 전화번호, 이메일 번호를 등록할 수 있습니다.
51
51
 
52
52
  ```typescript
53
- BluxClient.setUserProperties({
54
- phone_number: "+821011112222",
53
+ bluxClient.setUserProperties({
54
+ phone_number: "01011112222",
55
55
  email_address: "test@example.com",
56
56
  });
57
57
  ```
@@ -61,7 +61,7 @@ BluxClient.setUserProperties({
61
61
  - `setUserProperties`에서 설정할 수 있는 지정된 속성 외 임의의 속성을 부여할 수 있습니다.
62
62
 
63
63
  ```typescript
64
- BluxClient.setCustomUserProperties({
64
+ bluxClient.setCustomUserProperties({
65
65
  custom_key1: "any_value",
66
66
  custom_key2: true,
67
67
  custom_key3: null,
@@ -75,7 +75,7 @@ BluxClient.setCustomUserProperties({
75
75
  - 유저들을 더 잘 식별하기위해 사용됩니다.
76
76
 
77
77
  ```typescript
78
- BluxClient.signOut();
78
+ bluxClient.signOut();
79
79
  ```
80
80
 
81
81
  ### sendEvent
@@ -87,9 +87,9 @@ BluxClient.signOut();
87
87
  ---
88
88
 
89
89
  ```typescript
90
- BluxClient.sendEvent(
90
+ bluxClient.sendEvent(
91
91
  new AddProductDetailViewEvent({
92
- itemId: "ITEM_ID",
92
+ item_id: "ITEM_ID",
93
93
  }),
94
94
  );
95
95
  ```
@@ -101,9 +101,9 @@ BluxClient.sendEvent(
101
101
  ---
102
102
 
103
103
  ```typescript
104
- BluxClient.sendEvent(
104
+ bluxClient.sendEvent(
105
105
  new AddLikeEvent({
106
- itemId: "ITEM_ID",
106
+ item_id: "ITEM_ID",
107
107
  }),
108
108
  );
109
109
  ```
@@ -115,9 +115,9 @@ BluxClient.sendEvent(
115
115
  ---
116
116
 
117
117
  ```typescript
118
- BluxClient.sendEvent(
118
+ bluxClient.sendEvent(
119
119
  new AddCartaddEvent({
120
- itemId: "ITEM_ID",
120
+ item_id: "ITEM_ID",
121
121
  }),
122
122
  );
123
123
  ```
@@ -134,9 +134,9 @@ BluxClient.sendEvent(
134
134
  - `AddPurchaseEvent` 객체를 각 상품 구매건에 맞춰서 생성한 후 list 형태로 넘겨주시면 됩니다.
135
135
 
136
136
  ```typescript
137
- BluxClient.sendEvent(
137
+ bluxClient.sendEvent(
138
138
  new AddPurchaseEvent({
139
- itemId: "ITEM_ID",
139
+ item_id: "ITEM_ID",
140
140
  price: 1000,
141
141
  }),
142
142
  );
@@ -144,13 +144,13 @@ BluxClient.sendEvent(
144
144
 
145
145
  ```typescript
146
146
  // 복수 상품을 구매한 경우
147
- BluxClient.sendEvent([
147
+ bluxClient.sendEvent([
148
148
  new AddPurchaseEvent({
149
- itemId: "ITEM_ID_1",
149
+ item_id: "ITEM_ID_1",
150
150
  price: 1000,
151
151
  }),
152
152
  new AddPurchaseEvent({
153
- itemId: "ITEM_ID_2",
153
+ item_id: "ITEM_ID_2",
154
154
  price: 2000,
155
155
  }),
156
156
  ]);
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@blux.ai/web-sdk",
3
+ "version": "1.0.0-rc0",
4
+ "description": "The official Blux JavaScript browser client library",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "license": "UNLICENSED",
9
+ "scripts": {
10
+ "test": "jest",
11
+ "build": "tsc",
12
+ "dev": "yarn build -w",
13
+ "prepack": "rm -rf dist && yarn build",
14
+ "deploy": "npm publish --access public"
15
+ },
16
+ "author": "Z.Ai Inc.",
17
+ "homepage": "https://www.blux.ai/",
18
+ "devDependencies": {
19
+ "@sentry/types": "^8.35.0",
20
+ "@types/uuid": "^10.0.0",
21
+ "typescript": "^4.6.3"
22
+ },
23
+ "dependencies": {
24
+ "axios": "1.7.7",
25
+ "bson-objectid": "^2.0.4",
26
+ "dayjs": "1.11.13",
27
+ "lodash": "4.17.21",
28
+ "rxjs": "^7.8.1",
29
+ "uuid": "^10.0.0",
30
+ "zod": "3.23.8"
31
+ },
32
+ "installConfig": {
33
+ "hoistingLimits": "workspaces"
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blux.ai/web-sdk",
3
- "version": "0.0.7",
3
+ "version": "1.0.0-rc0",
4
4
  "description": "The official Blux JavaScript browser client library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "typescript": "^4.6.3"
22
22
  },
23
23
  "dependencies": {
24
- "axios": "^1.7.2",
24
+ "axios": "1.7.7",
25
25
  "bson-objectid": "^2.0.4",
26
26
  "dayjs": "1.11.13",
27
27
  "lodash": "4.17.21",
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import { render, screen } from "@testing-library/react";
3
- import App from "./App";
4
-
5
- test("renders learn react link", () => {
6
- render(<App />);
7
- const linkElement = screen.getByText(/learn react/i);
8
- expect(linkElement).toBeInTheDocument();
9
- });
package/demo/src/App.tsx DELETED
@@ -1,252 +0,0 @@
1
- import { useState } from "react";
2
- import { AddCustomEvent, ItemRecommendation, BluxClient } from "@blux.ai/web-sdk";
3
-
4
- const bluxClient = new BluxClient("stg");
5
- bluxClient.setLogLevel("debug");
6
-
7
- const searchParams = new URL(window.location.href).searchParams;
8
- const APPLICATION_ID_FROM_QUERY_PARAMS = searchParams.get("application_id");
9
- const API_KEY_FROM_QUERY_PARAMS = searchParams.get("api_key");
10
- const PHONE_NUMBER_FROM_QUERY_PARAMS = searchParams.get("phone_number");
11
- const EMAIL_FROM_QUERY_PARAMS = searchParams.get("email");
12
-
13
- function App() {
14
- const [applicationId, setApplicationId] = useState<string>(
15
- APPLICATION_ID_FROM_QUERY_PARAMS ?? "",
16
- );
17
- const [bluxApiKey, setBluxApiKey] = useState<string>(
18
- API_KEY_FROM_QUERY_PARAMS ?? "",
19
- );
20
-
21
- const [userId, signIn] = useState<string>(
22
- `test_user_id_${Math.floor(Math.random() * 100)}`,
23
- );
24
-
25
- const [telNumber, setTelNumber] = useState<string>(
26
- PHONE_NUMBER_FROM_QUERY_PARAMS ?? "",
27
- );
28
- const [email, setEmail] = useState<string>(EMAIL_FROM_QUERY_PARAMS ?? "");
29
- const [customKey, setCustomKey] = useState<string>("custom_key");
30
- const [customValue, setCustomValue] = useState<string>("custom_value");
31
- const [eventType, setEventType] = useState<string>("custom_event_type");
32
- const [itemId, setItemId] = useState<string>("item_id_3");
33
-
34
- // Recommendation Related States
35
- const [callType, setCallType] = useState<string>("");
36
- const [limit, setLimit] = useState<number>(10);
37
- const [offset, setOffset] = useState<number>(0);
38
- const [recommendationItemIds, setRecommendationItemIds] = useState<string>("ITEM_ID_1, ITEM_ID_2, ITEM_ID_3");
39
-
40
- const [isInitialized, setIsInitialized] = useState<boolean>(false);
41
-
42
- return (
43
- <div className="p-10">
44
- <div className="input-container flex flex-col">
45
- <div>BluxUser</div>
46
- <div>
47
- {bluxClient.bluxUser$.value
48
- ? JSON.stringify(bluxClient.bluxUser$.value, null, 2)
49
- : "not initialized"}
50
- </div>
51
- <div className="flex">
52
- <div>
53
- <div>ApplicationId</div>
54
- <input
55
- className="w-[500px] rounded-md border-black border-2"
56
- type="text"
57
- placeholder="Enter Application Id"
58
- value={applicationId}
59
- onChange={(e) => setApplicationId(e.target.value)}
60
- />
61
- <div className="mt-3">BluxApiKey</div>
62
- <input
63
- className="w-[500px] rounded-md border-black border-2"
64
- type="text"
65
- placeholder="Enter Blux API Key"
66
- value={bluxApiKey}
67
- onChange={(e) => setBluxApiKey(e.target.value)}
68
- />
69
- <div className="mt-3">User Id</div>
70
- <input
71
- className="w-[500px] rounded-md border-black border-2"
72
- type="text"
73
- placeholder="Enter User Id"
74
- value={userId}
75
- onChange={(e) => signIn(e.target.value)}
76
- />
77
- <div className="mt-3">Phone Number</div>
78
- <input
79
- className="w-[500px] rounded-md border-black border-2"
80
- type="text"
81
- placeholder="Enter phone number"
82
- value={telNumber}
83
- onChange={(e) => setTelNumber(e.target.value)}
84
- />
85
- <div className="mt-3">Email</div>
86
- <input
87
- className="w-[500px] rounded-md border-black border-2"
88
- type="text"
89
- placeholder="Enter email"
90
- value={email}
91
- onChange={(e) => setEmail(e.target.value)}
92
- />
93
- <div className="mt-3">CustomKey</div>
94
- <input
95
- className="w-[500px] rounded-md border-black border-2"
96
- type="text"
97
- placeholder="Enter custom key"
98
- value={customKey}
99
- onChange={(e) => setCustomKey(e.target.value)}
100
- />
101
- <div className="mt-3">CustomValue</div>
102
- <input
103
- className="w-[500px] rounded-md border-black border-2"
104
- type="text"
105
- placeholder="Enter custom value"
106
- value={customValue}
107
- onChange={(e) => setCustomValue(e.target.value)}
108
- />
109
- <div className="mt-3">CustomEventType</div>
110
- <input
111
- className="w-[500px] rounded-md border-black border-2"
112
- type="text"
113
- placeholder="Enter custom event type"
114
- value={eventType}
115
- onChange={(e) => setEventType(e.target.value)}
116
- />
117
- <div className="mt-3">CustomEvent ItemId</div>
118
- <input
119
- className="w-[500px] rounded-md border-black border-2"
120
- type="text"
121
- placeholder="Enter custom event item id"
122
- value={itemId}
123
- onChange={(e) => setItemId(e.target.value)}
124
- />
125
- </div>
126
- <div>
127
- <div className="mt-3 ml-10">RecommendationCallType</div>
128
- <input
129
- className="w-[500px] rounded-md border-black border-2 ml-10"
130
- type="text"
131
- placeholder="Enter call type for item recommendation"
132
- value={callType}
133
- onChange={(e) => setCallType(e.target.value)}
134
- />
135
- <div className="ml-10">RecommendationLimit</div>
136
- <input
137
- className="w-[500px] rounded-md border-black border-2 ml-10"
138
- type="text"
139
- placeholder="Enter recommendation limit"
140
- value={limit}
141
- onChange={(e) => setLimit(Number(e.target.value))}
142
- />
143
- <div className="mt-3 ml-10">RecommendationOffset</div>
144
- <input
145
- className="w-[500px] rounded-md border-black border-2 ml-10"
146
- type="text"
147
- placeholder="Enter recommendation offset"
148
- value={offset}
149
- onChange={(e) => setOffset(Number(e.target.value))}
150
- />
151
- <div className="mt-3 ml-10">RecommendationItemIds</div>
152
- <input
153
- className="w-[500px] rounded-md border-black border-2 ml-10"
154
- type="text"
155
- placeholder="Enter recommendation item ids (comma separated)"
156
- value={recommendationItemIds}
157
- onChange={(e) => setRecommendationItemIds(e.target.value)}
158
- />
159
- </div>
160
- </div>
161
- </div>
162
- <div className="mt-10 flex gap-4 w-[1000px] flex-wrap">
163
- <button
164
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
165
- onClick={() =>
166
- bluxClient
167
- .init({ applicationId, bluxApiKey })
168
- .then((isSuccess) => setIsInitialized(isSuccess))
169
- }
170
- disabled={applicationId === "" || bluxApiKey === ""}
171
- >
172
- init
173
- </button>
174
- <button
175
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
176
- onClick={() => bluxClient.signIn(userId)}
177
- disabled={!isInitialized}
178
- >
179
- signIn
180
- </button>
181
- <button
182
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
183
- onClick={() => bluxClient.signOut()}
184
- disabled={!isInitialized}
185
- >
186
- signOut
187
- </button>
188
- <button
189
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
190
- onClick={() =>
191
- bluxClient.setUserProperties({ phone_number: telNumber })
192
- }
193
- disabled={!isInitialized}
194
- >
195
- setUserProperties (phone number)
196
- </button>
197
- <button
198
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
199
- onClick={() => bluxClient.setUserProperties({ email_address: email })}
200
- disabled={!isInitialized}
201
- >
202
- setUserProperties (email)
203
- </button>
204
- <button
205
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
206
- onClick={() =>
207
- bluxClient.setCustomUserProperties({ [customKey]: customValue })
208
- }
209
- disabled={!isInitialized}
210
- >
211
- setCustomProperties
212
- </button>
213
- <button
214
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
215
- onClick={() =>
216
- bluxClient.sendEvent(
217
- new AddCustomEvent({
218
- item_id: itemId,
219
- event_properties: { [customKey]: customValue },
220
- event_type: eventType,
221
- }),
222
- )
223
- }
224
- disabled={!isInitialized}
225
- >
226
- sendCustomEvent
227
- </button>
228
- <button
229
- className="bg-blue-500 rounded-md p-4 disabled:bg-gray-300"
230
- onClick={async () =>
231
- {
232
- const recommendationResponse = await bluxClient.getItemRecommendation(
233
- new ItemRecommendation({
234
- call_type: callType,
235
- limit,
236
- offset,
237
- item_ids: recommendationItemIds ? recommendationItemIds.split(","): undefined,
238
- }),
239
- )
240
- console.log(recommendationResponse);
241
- }
242
- }
243
- disabled={!isInitialized || callType === ""}
244
- >
245
- getItemRecommendation
246
- </button>
247
- </div>
248
- </div>
249
- );
250
- }
251
-
252
- export default App;
@@ -1,16 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
- body {
5
- margin: 0;
6
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
7
- "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
8
- sans-serif;
9
- -webkit-font-smoothing: antialiased;
10
- -moz-osx-font-smoothing: grayscale;
11
- }
12
-
13
- code {
14
- font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
15
- monospace;
16
- }
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom/client";
3
- import "./index.css";
4
- import App from "./App";
5
- import reportWebVitals from "./reportWebVitals";
6
-
7
- const root = ReactDOM.createRoot(
8
- document.getElementById("root") as HTMLElement,
9
- );
10
- root.render(
11
- <React.StrictMode>
12
- <App />
13
- </React.StrictMode>,
14
- );
15
-
16
- // If you want to start measuring performance in your app, pass a function
17
- // to log results (for example: reportWebVitals(console.log))
18
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
19
- reportWebVitals();
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />
@@ -1,15 +0,0 @@
1
- import { ReportHandler } from "web-vitals";
2
-
3
- const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
- if (onPerfEntry && onPerfEntry instanceof Function) {
5
- import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
- getCLS(onPerfEntry);
7
- getFID(onPerfEntry);
8
- getFCP(onPerfEntry);
9
- getLCP(onPerfEntry);
10
- getTTFB(onPerfEntry);
11
- });
12
- }
13
- };
14
-
15
- export default reportWebVitals;
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import "@testing-library/jest-dom";
@@ -1,43 +0,0 @@
1
- import { BehaviorSubject } from "rxjs";
2
- import type { LogLevel } from "./utils/Logger";
3
- import type { EventRequest } from "./events/types";
4
- import type { Event } from "./events/Event";
5
- import type { Recommendation } from "./recommendations/Recommendation";
6
- import { type APIs } from "./apis/APIs";
7
- export type SdkInfo = {
8
- type: string;
9
- version: string;
10
- };
11
- type BluxUser = {
12
- id: string;
13
- bluxApiKey: string;
14
- applicationId: string;
15
- deviceId: string;
16
- userId?: string;
17
- };
18
- export declare class BluxClient {
19
- private readonly STAGE;
20
- private readonly api;
21
- private readonly sdkInfo;
22
- readonly bluxUser$: BehaviorSubject<BluxUser | undefined>;
23
- readonly requestQueue$: BehaviorSubject<EventRequest[]>;
24
- constructor(STAGE?: "local" | "dev" | "stg" | "prod");
25
- private generateApiHeader;
26
- init({ applicationId, bluxApiKey, }: {
27
- applicationId: string;
28
- bluxApiKey: string;
29
- }): Promise<boolean>;
30
- setLogLevel(logLevel: LogLevel): void;
31
- private getBluxUserWithTimeout;
32
- signIn(userId: string): Promise<void>;
33
- signOut(): Promise<void>;
34
- setUserProperties(userProperties: {
35
- phone_number?: string;
36
- email_address?: string;
37
- }): Promise<void>;
38
- setCustomUserProperties(customUserProperties: Record<string, string | boolean | number | null>): Promise<void>;
39
- sendEvent(event: Event | Event[]): void;
40
- getItemRecommendation(recommendation: Recommendation): Promise<APIs.bluxUsersGetItemRecommendations.ResponseData>;
41
- }
42
- export declare const bluxClient: BluxClient;
43
- export {};