@spacinbox/sdk 2.2.0 → 2.3.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/dist/index.cjs CHANGED
@@ -1448,6 +1448,16 @@ async function mountWidget(options) {
1448
1448
  setMetadata(data) {
1449
1449
  metadata.value = { ...metadata.value, ...data };
1450
1450
  },
1451
+ async logout() {
1452
+ isOpen.value = false;
1453
+ currentUser.value = null;
1454
+ metadata.value = {};
1455
+ resetRouter();
1456
+ SocketService.disconnect();
1457
+ VisitorService.clear();
1458
+ await VisitorService.init();
1459
+ await SocketService.connect();
1460
+ },
1451
1461
  shutdown() {
1452
1462
  (0, import_preact2.render)(null, mountPoint);
1453
1463
  host.remove();
@@ -1486,6 +1496,9 @@ var Spacinbox = {
1486
1496
  }
1487
1497
  return controller.identify(user);
1488
1498
  },
1499
+ async logout() {
1500
+ return controller?.logout();
1501
+ },
1489
1502
  setMetadata(data) {
1490
1503
  controller?.setMetadata(data);
1491
1504
  },