cap-hydra-web-sdk 1.0.8 → 1.1.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.
- package/README.md +25 -14
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -6
package/README.md
CHANGED
|
@@ -123,7 +123,6 @@ class SDKService {
|
|
|
123
123
|
remoteConfigKey: 'your_app_config_key',
|
|
124
124
|
appVersion: '1.0.0',
|
|
125
125
|
notifications: {
|
|
126
|
-
enableNotifications: true,
|
|
127
126
|
vapidKey: 'YOUR_VAPID_KEY',
|
|
128
127
|
},
|
|
129
128
|
});
|
|
@@ -348,6 +347,19 @@ WebSDK.identify({
|
|
|
348
347
|
|
|
349
348
|
**`Identifier.type` values:** `'email'`, `'mobile'`, `'externalId'`
|
|
350
349
|
|
|
350
|
+
**`IdentifyTraits` fields:**
|
|
351
|
+
|
|
352
|
+
| Field | Type | Description |
|
|
353
|
+
| ----------- | ------------------------- | ----------------------------------------------- |
|
|
354
|
+
| `firstName` | `string` | First name |
|
|
355
|
+
| `lastName` | `string` | Last name |
|
|
356
|
+
| `gender` | `string` | Gender |
|
|
357
|
+
| `birthday` | `string` | Birthday |
|
|
358
|
+
| `city` | `string` | City |
|
|
359
|
+
| `country` | `string` | Country |
|
|
360
|
+
| `timezone` | `string` | Timezone |
|
|
361
|
+
| `custom` | `Record<string, unknown>` | Additional custom attributes merged into events |
|
|
362
|
+
|
|
351
363
|
---
|
|
352
364
|
|
|
353
365
|
### 5. `getUser()`
|
|
@@ -365,18 +377,18 @@ console.log(userInfo.isFirstSession); // true
|
|
|
365
377
|
|
|
366
378
|
**Returns:** `UserInfo`
|
|
367
379
|
|
|
368
|
-
| Field
|
|
369
|
-
|
|
|
370
|
-
| `visitorId`
|
|
371
|
-
| `userId`
|
|
372
|
-
| `sessionId`
|
|
373
|
-
| `isIdentified`
|
|
374
|
-
| `isAnonymous`
|
|
375
|
-
| `profileTier`
|
|
376
|
-
| `attributes`
|
|
377
|
-
| `sessionNumber`
|
|
378
|
-
| `isFirstSession`
|
|
379
|
-
| `isReturningVisitor
|
|
380
|
+
| Field | Type | Description |
|
|
381
|
+
| -------------------- | --------------------------------- | ---------------------------------------- |
|
|
382
|
+
| `visitorId` | `string` | The anonymous visitor ID |
|
|
383
|
+
| `userId` | `string \| null` | Always `null` for anonymous users |
|
|
384
|
+
| `sessionId` | `string` | The current session ID |
|
|
385
|
+
| `isIdentified` | `boolean` | Always `false` for anonymous users |
|
|
386
|
+
| `isAnonymous` | `boolean` | Always `true` for anonymous users |
|
|
387
|
+
| `profileTier` | `'anonymous' \| 'known'` | Always `'anonymous'` for anonymous users |
|
|
388
|
+
| `attributes` | `Record<string, unknown> \| null` | Always `null` for anonymous users |
|
|
389
|
+
| `sessionNumber` | `number` | Number of sessions for this visitor |
|
|
390
|
+
| `isFirstSession` | `boolean` | `true` when `sessionNumber === 1` |
|
|
391
|
+
| `isReturningVisitor` | `boolean` | `true` when `sessionNumber > 1` |
|
|
380
392
|
|
|
381
393
|
**Throws:** `Error` if the user is identified (i.e., after `identify()` has been called).
|
|
382
394
|
|
|
@@ -423,7 +435,6 @@ WebSDK.initialize({
|
|
|
423
435
|
},
|
|
424
436
|
remoteConfigKey: 'your_app_config_key',
|
|
425
437
|
notifications: {
|
|
426
|
-
enableNotifications: true,
|
|
427
438
|
vapidKey: 'YOUR_VAPID_KEY',
|
|
428
439
|
serviceWorkerPath: '/firebase-messaging-sw.js',
|
|
429
440
|
},
|