@hanzo/event 0.3.25 → 0.3.26

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.ts CHANGED
@@ -8,7 +8,7 @@ declare function getFirstTouch(): Attribution | undefined;
8
8
  /** Read persisted cohort dimensions. */
9
9
  declare function getCohort(): Cohort | undefined;
10
10
 
11
- declare const VERSION = "0.3.25";
11
+ declare const VERSION = "0.3.26";
12
12
 
13
13
  /**
14
14
  * parseDsn parses "https://<version>:<hmac>@<host>/v1/sentry/<projectId>" into its
package/dist/index.mjs CHANGED
@@ -318,7 +318,7 @@ function uuidv7Time(id) {
318
318
  }
319
319
 
320
320
  // src/version.ts
321
- var VERSION = "0.3.25";
321
+ var VERSION = "0.3.26";
322
322
 
323
323
  // src/sentry.ts
324
324
  var MAX_FRAMES = 50;
@@ -735,17 +735,18 @@ var DefaultTransport = class {
735
735
  }
736
736
  }
737
737
  if (typeof fetch !== "function") return;
738
+ const simple = opts.ingestKey !== void 0 && opts.contentType === void 0;
738
739
  const headers = {
739
- "Content-Type": opts.contentType ?? "application/json"
740
+ "Content-Type": simple ? BEACON_CONTENT_TYPE : opts.contentType ?? "application/json"
740
741
  };
741
- const bearer = opts.ingestKey ?? opts.token;
742
+ const bearer = simple ? void 0 : opts.ingestKey ?? opts.token;
742
743
  if (bearer) headers.Authorization = `Bearer ${bearer}`;
743
- void fetch(url, {
744
+ void fetch(simple ? appendQuery(url, "ingest_key", opts.ingestKey) : url, {
744
745
  method: "POST",
745
746
  headers,
746
747
  body,
747
748
  keepalive: true,
748
- credentials: "include"
749
+ credentials: simple ? "omit" : "include"
749
750
  }).then((res) => {
750
751
  if (!res.ok && opts.debug) {
751
752
  console.warn("[event] ingest rejected", res.status, url.split("?")[0]);