glitchgrab 1.17.1 → 1.18.1

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.mts CHANGED
@@ -167,6 +167,7 @@ declare function ReportButton({ position, label, className, children, }: ReportB
167
167
  interface ErrorBoundaryProps {
168
168
  token: string;
169
169
  baseUrl?: string;
170
+ session?: GlitchgrabSession | null;
170
171
  onError?: (error: Error) => void;
171
172
  fallback?: React.ReactNode;
172
173
  visitedPages: string[];
package/dist/index.d.ts CHANGED
@@ -167,6 +167,7 @@ declare function ReportButton({ position, label, className, children, }: ReportB
167
167
  interface ErrorBoundaryProps {
168
168
  token: string;
169
169
  baseUrl?: string;
170
+ session?: GlitchgrabSession | null;
170
171
  onError?: (error: Error) => void;
171
172
  fallback?: React.ReactNode;
172
173
  visitedPages: string[];
package/dist/index.js CHANGED
@@ -405,6 +405,7 @@ var GlitchgrabErrorBoundary = class extends React.Component {
405
405
  if (this.props.onError) this.props.onError(error);
406
406
  return;
407
407
  }
408
+ const session = this.props.session;
408
409
  const payload = {
409
410
  token: this.props.token,
410
411
  source: "SDK_AUTO",
@@ -418,7 +419,11 @@ var GlitchgrabErrorBoundary = class extends React.Component {
418
419
  deviceInfo: (_b = context.deviceInfo) != null ? _b : void 0,
419
420
  metadata: {
420
421
  timestamp: context.timestamp,
421
- visitedPages: JSON.stringify(context.visitedPages)
422
+ visitedPages: JSON.stringify(context.visitedPages),
423
+ ...(session == null ? void 0 : session.userId) ? { sessionUserId: session.userId } : {},
424
+ ...(session == null ? void 0 : session.name) ? { sessionUserName: String(session.name) } : {},
425
+ ...(session == null ? void 0 : session.email) ? { sessionUserEmail: String(session.email) } : {},
426
+ ...(session == null ? void 0 : session.phone) ? { sessionUserPhone: String(session.phone) } : {}
422
427
  }
423
428
  };
424
429
  sendReport(payload, this.props.baseUrl);
@@ -1391,7 +1396,8 @@ function GlitchgrabProviderInner({
1391
1396
  colno: String((_f = event.colno) != null ? _f : ""),
1392
1397
  ...(session == null ? void 0 : session.userId) ? { sessionUserId: session.userId } : {},
1393
1398
  ...(session == null ? void 0 : session.name) ? { sessionUserName: String(session.name) } : {},
1394
- ...(session == null ? void 0 : session.email) ? { sessionUserEmail: String(session.email) } : {}
1399
+ ...(session == null ? void 0 : session.email) ? { sessionUserEmail: String(session.email) } : {},
1400
+ ...(session == null ? void 0 : session.phone) ? { sessionUserPhone: String(session.phone) } : {}
1395
1401
  }
1396
1402
  };
1397
1403
  sendReport(payload, baseUrl).then((result) => {
@@ -1430,7 +1436,8 @@ function GlitchgrabProviderInner({
1430
1436
  type: "unhandledrejection",
1431
1437
  ...(session == null ? void 0 : session.userId) ? { sessionUserId: session.userId } : {},
1432
1438
  ...(session == null ? void 0 : session.name) ? { sessionUserName: String(session.name) } : {},
1433
- ...(session == null ? void 0 : session.email) ? { sessionUserEmail: String(session.email) } : {}
1439
+ ...(session == null ? void 0 : session.email) ? { sessionUserEmail: String(session.email) } : {},
1440
+ ...(session == null ? void 0 : session.phone) ? { sessionUserPhone: String(session.phone) } : {}
1434
1441
  }
1435
1442
  };
1436
1443
  sendReport(payload, baseUrl).then((result) => {
@@ -1448,7 +1455,7 @@ function GlitchgrabProviderInner({
1448
1455
  };
1449
1456
  } catch (e) {
1450
1457
  }
1451
- }, [token, baseUrl, onError, onReportSent]);
1458
+ }, [token, baseUrl, onError, onReportSent, session]);
1452
1459
  const report = (0, import_react2.useCallback)(
1453
1460
  async (type, description, metadata) => {
1454
1461
  var _a;
@@ -1528,6 +1535,7 @@ function GlitchgrabProviderInner({
1528
1535
  {
1529
1536
  token,
1530
1537
  baseUrl,
1538
+ session,
1531
1539
  onError,
1532
1540
  fallback,
1533
1541
  visitedPages: visitedPagesRef.current,