@usermaven/nextjs 1.2.6 → 1.2.8

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.
Files changed (2) hide show
  1. package/lib/index.es.js +7 -5
  2. package/package.json +1 -1
package/lib/index.es.js CHANGED
@@ -1399,8 +1399,8 @@ _safewrap_instance_methods(autocapture);
1399
1399
 
1400
1400
  var VERSION_INFO = {
1401
1401
  env: 'production',
1402
- date: '2023-12-12T10:57:33.456Z',
1403
- version: '1.2.6'
1402
+ date: '2024-01-30T10:00:56.526Z',
1403
+ version: '1.2.8'
1404
1404
  };
1405
1405
  var USERMAVEN_VERSION = VERSION_INFO.version + "/" + VERSION_INFO.env + "@" + VERSION_INFO.date;
1406
1406
  var MAX_AGE_TEN_YEARS = 31622400 * 10;
@@ -1727,6 +1727,7 @@ var UsermavenClientImpl = /** @class */ (function () {
1727
1727
  this.trackingHost = "";
1728
1728
  this.idCookieName = "";
1729
1729
  this.randomizeUrl = false;
1730
+ this.namespace = "usermaven";
1730
1731
  this.apiKey = "";
1731
1732
  this.initialized = false;
1732
1733
  this._3pCookies = {};
@@ -1866,7 +1867,7 @@ var UsermavenClientImpl = /** @class */ (function () {
1866
1867
  url = this.trackingHost + "/api." + generateRandom() + "?p_" + generateRandom() + "=" + this.apiKey + cookiePolicy + ipPolicy;
1867
1868
  }
1868
1869
  var jsonString = JSON.stringify(json);
1869
- getLogger().debug("Sending payload to " + url, jsonString);
1870
+ getLogger().debug("Sending payload to " + url, json.length);
1870
1871
  return this.transport(url, jsonString, this.customHeaders(), function (code, body) {
1871
1872
  return _this.postHandle(code, body);
1872
1873
  });
@@ -2101,6 +2102,7 @@ var UsermavenClientImpl = /** @class */ (function () {
2101
2102
  ? defaultCompatMode
2102
2103
  : !!options.compat_mode;
2103
2104
  this.cookieDomain = options.cookie_domain || getCookieDomain();
2105
+ this.namespace = options.namespace || "usermaven";
2104
2106
  this.trackingHost = getHostWithProtocol(options["tracking_host"] || "t.usermaven.com");
2105
2107
  this.randomizeUrl = options.randomize_url || false;
2106
2108
  this.apiKey = options.key;
@@ -2164,7 +2166,7 @@ var UsermavenClientImpl = /** @class */ (function () {
2164
2166
  }
2165
2167
  if (isWindowAvailable()) {
2166
2168
  if (!options.disable_event_persistence) {
2167
- this.queue = new LocalStorageQueue("jitsu-event-queue");
2169
+ this.queue = new LocalStorageQueue(this.namespace + "-event-queue");
2168
2170
  this.scheduleFlush(0);
2169
2171
  }
2170
2172
  window.addEventListener("beforeunload", function () { return _this.flush(); });
@@ -2265,7 +2267,7 @@ var UsermavenClientImpl = /** @class */ (function () {
2265
2267
  */
2266
2268
  UsermavenClientImpl.prototype.manageAutoCapture = function (options) {
2267
2269
  getLogger().debug("Auto Capture Status: ", this.config['autocapture']);
2268
- this.__autocapture_enabled = this.config['autocapture'];
2270
+ this.__autocapture_enabled = this.config['autocapture'] && isWindowAvailable();
2269
2271
  if (!this.__autocapture_enabled) {
2270
2272
  return;
2271
2273
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usermaven/nextjs",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "Usermaven JavaScript SDK for NextJS",
5
5
  "author": "Usermaven <hello@usermaven.com>",
6
6
  "license": "MIT",