@hanzo/event 0.3.27 → 0.3.29

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/react.cjs CHANGED
@@ -83,7 +83,7 @@ function dsnForProduct(product, key) {
83
83
  if (!product || !key) return void 0;
84
84
  const projectId = PRODUCT_PROJECT[product];
85
85
  if (!projectId) return void 0;
86
- return `https://${key}@api.hanzo.ai/v1/sentry/${projectId}`;
86
+ return `https://${key}@api.hanzo.ai/v1/event/${projectId}`;
87
87
  }
88
88
 
89
89
  // src/scrub.ts
@@ -309,7 +309,7 @@ function hzAnonId() {
309
309
  }
310
310
 
311
311
  // src/version.ts
312
- var VERSION = "0.3.27";
312
+ var VERSION = "0.3.29";
313
313
 
314
314
  // src/sentry.ts
315
315
  var MAX_FRAMES = 50;
@@ -338,8 +338,9 @@ function parseDsn(dsn) {
338
338
  const projectId = segs.length > 0 ? segs[segs.length - 1] : "";
339
339
  if (!projectId) return null;
340
340
  const origin = `${scheme}://${host}`;
341
- const ingestUrl = `${origin}/v1/sentry/${encodeURIComponent(projectId)}/envelope/?sentry_key=${encodeURIComponent(publicKey)}`;
342
- return { publicKey, origin, projectId, ingestUrl };
341
+ const base = `${origin}/${segs.map(encodeURIComponent).join("/")}`;
342
+ const ingestUrl = `${base}/envelope/?sentry_key=${encodeURIComponent(publicKey)}`;
343
+ return { publicKey, origin, projectId, base, ingestUrl };
343
344
  }
344
345
  var V8_FRAME = /^\s*at\s+(?:(.+?)\s+\()?(?:(.+?):(\d+):(\d+)|([^)]+))\)?\s*$/;
345
346
  var MOZ_FRAME = /^\s*(?:(.*?)@)?(.+?):(\d+):(\d+)\s*$/;
@@ -488,7 +489,7 @@ function buildEnvelope(event, dsn, sentAt) {
488
489
  const payload = JSON.stringify(event);
489
490
  const header = JSON.stringify({
490
491
  event_id: event.event_id,
491
- dsn: `${dsn.origin}/v1/sentry/${dsn.projectId}`,
492
+ dsn: dsn.base,
492
493
  sent_at: (/* @__PURE__ */ new Date()).toISOString()
493
494
  });
494
495
  const itemHeader = JSON.stringify({
@@ -1052,7 +1053,7 @@ function registry() {
1052
1053
  return fresh;
1053
1054
  }
1054
1055
  function createAnalytics(config) {
1055
- if (!isBrowser()) return new Analytics(config);
1056
+ if (!isBrowser() || config.enabled === false) return new Analytics(config);
1056
1057
  const key = (config.host ?? DEFAULT_HOST) + "\0" + config.product;
1057
1058
  const clients = registry();
1058
1059
  const existing = clients.get(key);