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

@weeb_services/wapi-core

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@weeb_services/wapi-core - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1-alpha1

26

lib/middleware/tracking.middleware.js

@@ -5,2 +5,9 @@ const Middleware = require('./base.middleware')

class Track extends Middleware {
constructor (name, version, environment) {
super()
this.name = name
this.version = version
this.environment = environment
}
async exec (req) {

@@ -20,9 +27,20 @@ let ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress

}
const visitor = ua(req.config.track, {https: true})
visitor.pageview({
const visitor = ua(req.config.track, uid, {https: true, strictCidFormat: false})
const trackingData = {
uid,
uip: ip,
ua: req.headers['user-agent'],
dl: fullUrl
}, (err) => {
dl: fullUrl,
an: `${this.name}_${this.environment}`,
av: this.version
}
if (req.account) {
const extraData = {
cd1: req.account.discordUserId,
cd2: req.account.id,
cd3: req.account.name
}
Object.assign(trackingData, extraData)
}
visitor.pageview(trackingData, (err) => {
if (err) {

@@ -29,0 +47,0 @@ console.log(err)

2

package.json
{
"name": "@weeb_services/wapi-core",
"version": "1.4.0",
"version": "1.4.1-alpha1",
"description": "Weeb API core",

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

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