Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swdc-tracker

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swdc-tracker - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

30

dist/index.js

@@ -57,2 +57,10 @@ "use strict";

swdcTracker.spTracker = tracker([e], namespace, appId, false);
if (process.env.ENABLE_SWDC_TRACKER === "true") {
swdcTracker.testMode = false;
console.log('swdc-tracker initialized and ready to send events');
}
else {
swdcTracker.testMode = true;
console.log('swdc-tracker test mode on. set env ENABLE_SWDC_TRACKER to "true" to send events');
}
return [3 /*break*/, 3];

@@ -94,4 +102,8 @@ case 2:

];
swdcTracker.spTracker.trackUnstructEvent(properties, contexts);
swdcTracker.spTracker.trackUnstructEvent(properties, contexts);
if (swdcTracker.testMode) {
testEvent(properties, contexts);
}
else {
swdcTracker.spTracker.trackUnstructEvent(properties, contexts);
}
return [2 /*return*/];

@@ -131,4 +143,16 @@ }

];
swdcTracker.spTracker.trackUnstructEvent(properties, contexts);
if (swdcTracker.testMode) {
testEvent(properties, contexts);
}
else {
swdcTracker.spTracker.trackUnstructEvent(properties, contexts);
}
};
function testEvent(properties, contexts) {
var event = {
properties: properties,
contexts: contexts
};
console.log("swdc-tracker test mode on. trackUnstructEvent was called with the following payload: ", event);
}
exports.default = swdcTracker;

2

package.json
{
"name": "swdc-tracker",
"version": "1.0.2",
"version": "1.0.3",
"description": "swdc event tracker",

@@ -5,0 +5,0 @@ "main": "dist",

@@ -23,3 +23,12 @@ import { get } from "./utils/http";

const e = emitter(tracker_api_host)
swdcTracker.spTracker = tracker([e], namespace, appId, false)
if(process.env.ENABLE_SWDC_TRACKER === "true") {
swdcTracker.testMode = false
console.log('swdc-tracker initialized and ready to send events')
} else {
swdcTracker.testMode = true
console.log('swdc-tracker test mode on. set env ENABLE_SWDC_TRACKER to "true" to send events')
}
} catch(e) {

@@ -80,5 +89,7 @@ console.log("swdcTracker failed to initialize", e)

swdcTracker.spTracker.trackUnstructEvent(properties, contexts)
swdcTracker.spTracker.trackUnstructEvent(properties, contexts);
if(swdcTracker.testMode){
testEvent(properties, contexts)
} else {
swdcTracker.spTracker.trackUnstructEvent(properties, contexts)
}
}

@@ -169,5 +180,17 @@

swdcTracker.spTracker.trackUnstructEvent(properties, contexts)
if(swdcTracker.testMode){
testEvent(properties, contexts)
} else {
swdcTracker.spTracker.trackUnstructEvent(properties, contexts)
}
}
function testEvent(properties: any, contexts: any): void {
const event = {
properties: properties,
contexts: contexts
}
console.log("swdc-tracker test mode on. trackUnstructEvent was called with the following payload: ", event)
}
export default swdcTracker;
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