@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/LICENSE.md +21 -0
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +6 -5
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +6 -5
- package/dist/react.mjs.map +1 -1
- package/hz.js +19 -20
- package/package.json +10 -10
- package/src/core.ts +12 -4
- package/src/hz.test.ts +14 -3
- package/src/transport.test.ts +7 -1
- package/src/version.ts +1 -1
- package/src/stack.ts +0 -144
package/dist/react.cjs
CHANGED
|
@@ -309,7 +309,7 @@ function hzAnonId() {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
// src/version.ts
|
|
312
|
-
var VERSION = "0.3.
|
|
312
|
+
var VERSION = "0.3.26";
|
|
313
313
|
|
|
314
314
|
// src/sentry.ts
|
|
315
315
|
var MAX_FRAMES = 50;
|
|
@@ -726,17 +726,18 @@ var DefaultTransport = class {
|
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
if (typeof fetch !== "function") return;
|
|
729
|
+
const simple = opts.ingestKey !== void 0 && opts.contentType === void 0;
|
|
729
730
|
const headers = {
|
|
730
|
-
"Content-Type": opts.contentType ?? "application/json"
|
|
731
|
+
"Content-Type": simple ? BEACON_CONTENT_TYPE : opts.contentType ?? "application/json"
|
|
731
732
|
};
|
|
732
|
-
const bearer = opts.ingestKey ?? opts.token;
|
|
733
|
+
const bearer = simple ? void 0 : opts.ingestKey ?? opts.token;
|
|
733
734
|
if (bearer) headers.Authorization = `Bearer ${bearer}`;
|
|
734
|
-
void fetch(url, {
|
|
735
|
+
void fetch(simple ? appendQuery(url, "ingest_key", opts.ingestKey) : url, {
|
|
735
736
|
method: "POST",
|
|
736
737
|
headers,
|
|
737
738
|
body,
|
|
738
739
|
keepalive: true,
|
|
739
|
-
credentials: "include"
|
|
740
|
+
credentials: simple ? "omit" : "include"
|
|
740
741
|
}).then((res) => {
|
|
741
742
|
if (!res.ok && opts.debug) {
|
|
742
743
|
console.warn("[event] ingest rejected", res.status, url.split("?")[0]);
|