@bbearai/core 0.5.3 → 0.5.4

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.js CHANGED
@@ -264,13 +264,13 @@ var ContextCaptureManager = class {
264
264
  return Object.keys(metrics).length > 0 ? metrics : void 0;
265
265
  }
266
266
  getEnvironmentInfo() {
267
- if (typeof window === "undefined" || typeof navigator === "undefined") return void 0;
267
+ if (typeof window === "undefined" || typeof navigator === "undefined" || typeof document === "undefined") return void 0;
268
268
  return {
269
269
  language: navigator.language,
270
270
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
271
- cookiesEnabled: navigator.cookieEnabled,
271
+ cookiesEnabled: navigator.cookieEnabled ?? false,
272
272
  localStorage: typeof localStorage !== "undefined",
273
- online: navigator.onLine
273
+ online: navigator.onLine ?? true
274
274
  };
275
275
  }
276
276
  };
@@ -1621,15 +1621,18 @@ var BugBearClient = class {
1621
1621
  * Get device info (override in platform-specific implementations)
1622
1622
  */
1623
1623
  getDeviceInfo() {
1624
- if (typeof window !== "undefined") {
1625
- return {
1626
- platform: "web",
1627
- userAgent: navigator.userAgent,
1628
- screenSize: {
1624
+ if (typeof window !== "undefined" && typeof document !== "undefined") {
1625
+ const info = { platform: "web" };
1626
+ if (typeof navigator !== "undefined" && navigator.userAgent) {
1627
+ info.userAgent = navigator.userAgent;
1628
+ }
1629
+ if (window.screen) {
1630
+ info.screenSize = {
1629
1631
  width: window.screen.width,
1630
1632
  height: window.screen.height
1631
- }
1632
- };
1633
+ };
1634
+ }
1635
+ return info;
1633
1636
  }
1634
1637
  return { platform: "web" };
1635
1638
  }
package/dist/index.mjs CHANGED
@@ -230,13 +230,13 @@ var ContextCaptureManager = class {
230
230
  return Object.keys(metrics).length > 0 ? metrics : void 0;
231
231
  }
232
232
  getEnvironmentInfo() {
233
- if (typeof window === "undefined" || typeof navigator === "undefined") return void 0;
233
+ if (typeof window === "undefined" || typeof navigator === "undefined" || typeof document === "undefined") return void 0;
234
234
  return {
235
235
  language: navigator.language,
236
236
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
237
- cookiesEnabled: navigator.cookieEnabled,
237
+ cookiesEnabled: navigator.cookieEnabled ?? false,
238
238
  localStorage: typeof localStorage !== "undefined",
239
- online: navigator.onLine
239
+ online: navigator.onLine ?? true
240
240
  };
241
241
  }
242
242
  };
@@ -1587,15 +1587,18 @@ var BugBearClient = class {
1587
1587
  * Get device info (override in platform-specific implementations)
1588
1588
  */
1589
1589
  getDeviceInfo() {
1590
- if (typeof window !== "undefined") {
1591
- return {
1592
- platform: "web",
1593
- userAgent: navigator.userAgent,
1594
- screenSize: {
1590
+ if (typeof window !== "undefined" && typeof document !== "undefined") {
1591
+ const info = { platform: "web" };
1592
+ if (typeof navigator !== "undefined" && navigator.userAgent) {
1593
+ info.userAgent = navigator.userAgent;
1594
+ }
1595
+ if (window.screen) {
1596
+ info.screenSize = {
1595
1597
  width: window.screen.width,
1596
1598
  height: window.screen.height
1597
- }
1598
- };
1599
+ };
1600
+ }
1601
+ return info;
1599
1602
  }
1600
1603
  return { platform: "web" };
1601
1604
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbearai/core",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Core utilities and types for BugBear QA platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",