@usermaven/nextjs 1.4.1-rc.63 → 1.4.1-rc.64
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/lib/index.es.js +14 -14
- package/package.json +2 -2
package/lib/index.es.js
CHANGED
|
@@ -1008,17 +1008,18 @@ class we {
|
|
|
1008
1008
|
return e;
|
|
1009
1009
|
}
|
|
1010
1010
|
initializeTransport(e) {
|
|
1011
|
+
const t = "https://events.usermaven.com";
|
|
1011
1012
|
if (!u())
|
|
1012
|
-
return new ye(e.trackingHost, e);
|
|
1013
|
-
const
|
|
1014
|
-
if (e.useBeaconApi &&
|
|
1015
|
-
return new de(e.trackingHost, e, this.logger);
|
|
1016
|
-
if (e.forceUseFetch &&
|
|
1017
|
-
return new D(e.trackingHost, e, this.logger);
|
|
1018
|
-
if (t)
|
|
1019
|
-
return new fe(e.trackingHost, e, this.logger);
|
|
1013
|
+
return new ye(e.trackingHost || t, e);
|
|
1014
|
+
const s = "XMLHttpRequest" in window, n = typeof fetch < "u", r = typeof navigator < "u" && "sendBeacon" in navigator;
|
|
1015
|
+
if (e.useBeaconApi && r)
|
|
1016
|
+
return new de(e.trackingHost || t, e, this.logger);
|
|
1017
|
+
if (e.forceUseFetch && n)
|
|
1018
|
+
return new D(e.trackingHost || t, e, this.logger);
|
|
1020
1019
|
if (s)
|
|
1021
|
-
return new
|
|
1020
|
+
return new fe(e.trackingHost || t, e, this.logger);
|
|
1021
|
+
if (n)
|
|
1022
|
+
return new D(e.trackingHost || t, e, this.logger);
|
|
1022
1023
|
throw new Error("No suitable transport method available");
|
|
1023
1024
|
}
|
|
1024
1025
|
initializePersistence() {
|
|
@@ -1092,7 +1093,7 @@ class we {
|
|
|
1092
1093
|
this.persistence.set("companyProps", e), t || await this.track("group", e), this.logger.info("Company identified:", e);
|
|
1093
1094
|
}
|
|
1094
1095
|
createEventPayload(e, t) {
|
|
1095
|
-
const s = this.persistence.get("userProps") || {}, n = this.persistence.get("companyProps") || void 0, r = this.persistence.get("userId"), o = this.persistence.get("global_props") || {}, c = this.persistence.get(`props_${e}`) || {};
|
|
1096
|
+
const s = this.persistence.get("userProps") || {}, n = this.persistence.get("companyProps") || (s == null ? void 0 : s.company) || {}, r = this.persistence.get("userId"), o = this.persistence.get("global_props") || {}, c = this.persistence.get(`props_${e}`) || {};
|
|
1096
1097
|
let l = t || {};
|
|
1097
1098
|
const a = {
|
|
1098
1099
|
event_id: "",
|
|
@@ -1115,10 +1116,9 @@ class we {
|
|
|
1115
1116
|
if (e === "$autocapture") {
|
|
1116
1117
|
const h = this.processAutocaptureAttributes(t || {});
|
|
1117
1118
|
a.autocapture_attributes = h;
|
|
1118
|
-
} else
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
}), a.event_attributes = l;
|
|
1119
|
+
} else e !== "user_identify" && e !== "group" && (Array.isArray(this.config.propertyBlacklist) && this.config.propertyBlacklist.forEach((h) => {
|
|
1120
|
+
delete l[h];
|
|
1121
|
+
}), a.event_attributes = l);
|
|
1122
1122
|
return u() && (a.referer = document.referrer, a.url = window.location.href, a.page_title = document.title, a.doc_path = window.location.pathname, a.doc_host = window.location.hostname, a.doc_search = window.location.search, a.screen_resolution = `${window.screen.width}x${window.screen.height}`, a.vp_size = `${window.innerWidth}x${window.innerHeight}`, a.user_agent = navigator.userAgent, a.user_language = navigator.language, a.doc_encoding = document.characterSet, a.utm = this.getUtmParams()), a;
|
|
1123
1123
|
}
|
|
1124
1124
|
processAutocaptureAttributes(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usermaven/nextjs",
|
|
3
|
-
"version": "1.4.1-rc.
|
|
3
|
+
"version": "1.4.1-rc.64",
|
|
4
4
|
"description": "Usermaven JavaScript SDK for NextJS",
|
|
5
5
|
"author": "Usermaven <hello@usermaven.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@usermaven/sdk-js": "1.4.1-rc.
|
|
21
|
+
"@usermaven/sdk-js": "1.4.1-rc.64",
|
|
22
22
|
"cookie": "^0.5.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|