@suprsend/web-sdk 3.0.2 → 3.0.3

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 CHANGED
@@ -130,7 +130,7 @@ Create `serviceworker.js` file such that it should be publicly accessible from `
130
130
 
131
131
  ```javascript
132
132
  importScripts(
133
- 'https://cdn.jsdelivr.net/npm/@suprsend/web-sdk@2.0.0/public/serviceworker.min.js'
133
+ 'https://cdn.jsdelivr.net/npm/@suprsend/web-sdk@3.0.3/public/serviceworker.min.js'
134
134
  );
135
135
 
136
136
  initSuprSend(publicApiKey);
@@ -258,6 +258,10 @@ feedClient.remove();
258
258
  // If stores are used, this method will change active store
259
259
  feedClient.changeActiveStore(storeId: string)
260
260
 
261
+ // Used to reset badge count which is shown on bell icon. This count is latest notifications that user received from the last he opened inbox popup.
262
+ // call this on click of bell icon
263
+ feedClient.resetBadgeCount()
264
+
261
265
  // mark notification as seen
262
266
  await feedClient.markAsSeen(notificationId: string)
263
267
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suprsend/web-sdk",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "The client side javascript library for interacting with SuprSend",
5
5
  "author": "SuprSend Developers",
6
6
  "type": "module",
@@ -74,7 +74,7 @@ function callSSApi(body, method = 'post') {
74
74
  function initSuprSend(key, options) {
75
75
  suprsendConfig.publicApiKey = key;
76
76
 
77
- if (options.host) {
77
+ if (options && options.host) {
78
78
  suprsendConfig.host = options.host;
79
79
  }
80
80
  }