@spacinbox/sdk 2.1.0 → 2.2.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.d.cts CHANGED
@@ -22,7 +22,9 @@ declare function mountWidget(options: BootOptions): Promise<{
22
22
 
23
23
  type Controller = Awaited<ReturnType<typeof mountWidget>>;
24
24
  declare const Spacinbox: {
25
- boot(options: BootOptions): Promise<void>;
25
+ boot(options: BootOptions): Promise<{
26
+ success: boolean;
27
+ }>;
26
28
  identify(user: Parameters<Controller["identify"]>[0]): Promise<{
27
29
  success: boolean;
28
30
  }>;
package/dist/index.d.ts CHANGED
@@ -22,7 +22,9 @@ declare function mountWidget(options: BootOptions): Promise<{
22
22
 
23
23
  type Controller = Awaited<ReturnType<typeof mountWidget>>;
24
24
  declare const Spacinbox: {
25
- boot(options: BootOptions): Promise<void>;
25
+ boot(options: BootOptions): Promise<{
26
+ success: boolean;
27
+ }>;
26
28
  identify(user: Parameters<Controller["identify"]>[0]): Promise<{
27
29
  success: boolean;
28
30
  }>;
package/dist/index.js CHANGED
@@ -1448,16 +1448,17 @@ async function mountWidget(options) {
1448
1448
  var controller = null;
1449
1449
  var bootPromise = null;
1450
1450
  var Spacinbox = {
1451
- boot(options) {
1451
+ async boot(options) {
1452
1452
  if (typeof document === "undefined") {
1453
- return Promise.resolve();
1453
+ return Promise.resolve({ success: false });
1454
1454
  }
1455
1455
  if (bootPromise) {
1456
1456
  return bootPromise;
1457
1457
  }
1458
1458
  bootPromise = mountWidget(options).then((instance) => {
1459
1459
  controller = instance;
1460
- });
1460
+ return { success: true };
1461
+ }).catch(() => ({ success: false }));
1461
1462
  return bootPromise;
1462
1463
  },
1463
1464
  async identify(user) {