web-manager 3.2.51 → 3.2.53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +26 -9
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -486,6 +486,8 @@ function Manager() {
486
486
  config: {
487
487
  dsn: '',
488
488
  release: '',
489
+ replaysSessionSampleRate: 0.1,
490
+ replaysOnErrorSampleRate: 1.0,
489
491
  },
490
492
  },
491
493
  chatsy: {
@@ -1476,50 +1478,65 @@ function Manager() {
1476
1478
  if (options.libraries.sentry.enabled === true) {
1477
1479
  import('@sentry/browser')
1478
1480
  .then(function(mod) {
1481
+ // Set global
1479
1482
  window.Sentry = mod;
1483
+
1484
+ // Set config
1480
1485
  var config = options.libraries.sentry.config;
1481
1486
  config.release = config.release + '@' + self.properties.global.version;
1482
1487
  config.environment = self.properties.meta.environment;
1488
+ config.integrations = config.integrations || [];
1483
1489
 
1484
1490
  // if (self.isDevelopment()) {
1485
1491
  // config.dsn = 'https://901db748bbb9469f860dc36fb07a4374@o1120154.ingest.sentry.io/6155285';
1486
1492
  // }
1487
1493
 
1494
+ // Add integration: browser tracing
1495
+ config.integrations.push(Sentry.browserTracingIntegration());
1496
+
1497
+ // Add integration: replay
1488
1498
  if (config.replaysSessionSampleRate > 0 || config.replaysOnErrorSampleRate > 0) {
1489
- config.integrations = [
1490
- new Sentry.Replay({
1491
- // Additional SDK configuration goes in here, for example:
1492
- // maskAllText: true,
1493
- // blockAllMedia: true,
1494
- }),
1495
- ]
1499
+ config.integrations.push(Sentry.replayIntegration({
1500
+ maskAllText: false,
1501
+ blockAllMedia: false,
1502
+ }));
1496
1503
  }
1497
1504
 
1505
+ // Setup before send
1498
1506
  config.beforeSend = function (event, hint) {
1499
1507
  var startTime = self.properties.page.startTime;
1500
1508
  var hoursSinceStart = (new Date() - startTime) / (1000 * 3600);
1501
1509
 
1510
+ // Setup tags
1502
1511
  event.tags = event.tags || {};
1503
1512
  event.tags['process.type'] = event.tags['process.type'] || 'browser';
1504
-
1505
1513
  // event.tags['usage.total.opens'] = parseInt(usage.total.opens);
1506
1514
  // event.tags['usage.total.hours'] = usage.total.hours;
1507
1515
  event.tags['usage.session.hours'] = hoursSinceStart.toFixed(2);
1508
1516
  // event.tags['store'] = self.properties().isStore();
1517
+
1518
+ // Setup user
1509
1519
  event.user = event.user || {};
1510
1520
  event.user.email = storage.get('user.auth.email', '')
1511
1521
  event.user.uid = storage.get('user.auth.uid', '');
1512
1522
  // event.user.ip = storage.get('user.ip', '');
1513
1523
 
1524
+ // Log to console
1514
1525
  console.error('[SENTRY] Caught error', event, hint);
1515
1526
 
1527
+ // Skip processing the event
1516
1528
  if (self.isDevelopment()) {
1517
1529
  return null;
1518
1530
  }
1519
1531
 
1532
+ // Process the event
1520
1533
  return event;
1521
1534
  }
1535
+
1536
+ // Initialize
1522
1537
  Sentry.init(config);
1538
+
1539
+ // Resolve
1523
1540
  resolve();
1524
1541
  })
1525
1542
  .catch(reject);
@@ -1565,7 +1582,7 @@ function Manager() {
1565
1582
  if (featuresDefault && featuresCustom) {
1566
1583
  cb();
1567
1584
  } else {
1568
- loadScript({src: 'https://polyfill.io/v3/polyfill.min.js?flags=always%2Cgated&features=default%2Ces5%2Ces6%2Ces7%2CPromise.prototype.finally%2C%7Ehtml5-elements%2ClocalStorage%2Cfetch%2CURLSearchParams'})
1585
+ loadScript({src: 'https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?flags=always%2Cgated&features=default%2Ces5%2Ces6%2Ces7%2CPromise.prototype.finally%2C%7Ehtml5-elements%2ClocalStorage%2Cfetch%2CURLSearchParams'})
1569
1586
  .then(function() {
1570
1587
  cb();
1571
1588
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.51",
3
+ "version": "3.2.53",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -40,7 +40,7 @@
40
40
  "replace": {}
41
41
  },
42
42
  "dependencies": {
43
- "@sentry/browser": "^7.117.0",
43
+ "@sentry/browser": "^8.13.0",
44
44
  "cookieconsent": "^3.1.1",
45
45
  "firebase": "^9.23.0",
46
46
  "itwcw-package-analytics": "^1.0.4",
@@ -49,6 +49,6 @@
49
49
  "devDependencies": {
50
50
  "lodash": "^4.17.21",
51
51
  "mocha": "^8.4.0",
52
- "prepare-package": "^1.1.12"
52
+ "prepare-package": "^1.1.13"
53
53
  }
54
- }
54
+ }