@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.mjs
CHANGED
|
@@ -307,7 +307,7 @@ function hzAnonId() {
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
// src/version.ts
|
|
310
|
-
var VERSION = "0.3.
|
|
310
|
+
var VERSION = "0.3.26";
|
|
311
311
|
|
|
312
312
|
// src/sentry.ts
|
|
313
313
|
var MAX_FRAMES = 50;
|
|
@@ -724,17 +724,18 @@ var DefaultTransport = class {
|
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
726
|
if (typeof fetch !== "function") return;
|
|
727
|
+
const simple = opts.ingestKey !== void 0 && opts.contentType === void 0;
|
|
727
728
|
const headers = {
|
|
728
|
-
"Content-Type": opts.contentType ?? "application/json"
|
|
729
|
+
"Content-Type": simple ? BEACON_CONTENT_TYPE : opts.contentType ?? "application/json"
|
|
729
730
|
};
|
|
730
|
-
const bearer = opts.ingestKey ?? opts.token;
|
|
731
|
+
const bearer = simple ? void 0 : opts.ingestKey ?? opts.token;
|
|
731
732
|
if (bearer) headers.Authorization = `Bearer ${bearer}`;
|
|
732
|
-
void fetch(url, {
|
|
733
|
+
void fetch(simple ? appendQuery(url, "ingest_key", opts.ingestKey) : url, {
|
|
733
734
|
method: "POST",
|
|
734
735
|
headers,
|
|
735
736
|
body,
|
|
736
737
|
keepalive: true,
|
|
737
|
-
credentials: "include"
|
|
738
|
+
credentials: simple ? "omit" : "include"
|
|
738
739
|
}).then((res) => {
|
|
739
740
|
if (!res.ok && opts.debug) {
|
|
740
741
|
console.warn("[event] ingest rejected", res.status, url.split("?")[0]);
|