@rivium/push-web 0.1.0 → 0.1.2

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/dist/index.d.ts CHANGED
@@ -329,6 +329,8 @@ export type RiviumPushAnalyticsCallback = (event: RiviumPushAnalyticsEvent, prop
329
329
  declare class RiviumPush {
330
330
  private config;
331
331
  private deviceId;
332
+ private subscriptionId;
333
+ private userId;
332
334
  private pnSocket;
333
335
  private serviceWorkerRegistration;
334
336
  private pushSubscription;
@@ -429,13 +431,24 @@ declare class RiviumPush {
429
431
  */
430
432
  getDeviceId(): string | null;
431
433
  /**
432
- * Set user ID
434
+ * Get the per-install subscription ID issued by the server during registration.
435
+ * This is the canonical addressing key for inbox / A-B / in-app calls and the
436
+ * new MQTT topic. Returns `null` until registration succeeds at least once.
437
+ */
438
+ getSubscriptionId(): string | null;
439
+ /**
440
+ * Set user ID. Persisted in localStorage so subsequent page loads pick up
441
+ * the same identity automatically (matches OneSignal/Airship behaviour).
433
442
  */
434
443
  setUserId(userId: string): Promise<void>;
435
444
  /**
436
- * Clear user ID
445
+ * Clear user ID. Call this on logout.
437
446
  */
438
447
  clearUserId(): void;
448
+ /**
449
+ * Get the currently-stored userId, if any. Survives page reloads.
450
+ */
451
+ getUserId(): string | null;
439
452
  /**
440
453
  * Get the message that launched/opened the app (when user tapped a notification)
441
454
  * Returns null if the app was not opened from a notification tap