New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mrporter/frontend-monitoring

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mrporter/frontend-monitoring - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

22

dist/index.js

@@ -32,9 +32,13 @@ 'use strict';

value: function trackEvent(event) {
if (!this.client) {
console.log('Keen Event (Dev Mode): ', event);
} else if (event) {
var collection = event.collection;
var event_data = event.event_data;
var sampleRate = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1];
this.client.addEvent(collection, { event_data: event_data });
if (Math.random() < sampleRate) {
if (!this.client) {
console.log('Keen Event (Dev Mode): ', event);
} else if (event) {
var collection = event.collection;
var event_data = event.event_data;
this.client.addEvent(collection, { event_data: event_data });
}
}

@@ -47,7 +51,9 @@ }

this.trackEvent((0, _events.pagePerformance)());
var sampleRate = arguments.length <= 0 || arguments[0] === undefined ? 1 : arguments[0];
this.trackEvent((0, _events.pagePerformance)(), sampleRate);
document.onreadystatechange = function () {
if (document.readyState === 'complete') {
_this.trackEvent((0, _events.domPerformance)());
_this.trackEvent((0, _events.domPerformance)(), sampleRate);
}

@@ -54,0 +60,0 @@ };

{
"name": "@mrporter/frontend-monitoring",
"version": "1.0.0",
"version": "1.0.1",
"description": "Utils and Events for MRP front end monitoring",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -19,3 +19,3 @@ # MRP Front End Monitoring

```
monitoring.trackEvent(event);
monitoring.trackEvent(event, sampleRate);

@@ -28,2 +28,4 @@ // event should be of the form:

```
The sampleRate is a float between 0 and 1, representing the proportion of events you want to track (e.g, 0 tracks nothing, 0.5 tracks half the events, 1 tracks all.)
The following global properties are sent with every event:

@@ -30,0 +32,0 @@ (see https://keen.io/docs/api/#data-enrichment)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc