Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
analytics-encryption
Advanced tools
analytics-encryption
Config-based encryption for analytics
on the server and in the browser.
Install with npm:
npm install --save analytics-encryption
Or with yarn:
yarn add analytics-encryption
import analyticsEncryption from 'analytics-encryption'
// Tries to find `window.analytics` and extend `.track/identify()`
const encryptedAnalytics = analyticsEncryption()
// Or you can pass in an analytics object
const analytics = analyticsEncryption({ analytics: trackingV1 })
// ./analytics.js
import Analytics from 'analytics-node'
import EncryptionClient from '@ume/client'
import analyticsEncryption from 'analytics-encryption'
const apiHost = process.env.UME_API_HOST
const eclient = new EncryptionClient({ apiHost })
const originalAnalytics = new Analytics(process.env.WRITE_KEY)
const analytics = analyticsEncryption({
analytics: originalAnalytics,
local: { encrypt: eclient.encrypt.bind(eclient) }
})
const { track, identify } = analytics
export default analytics
export { track, identify }
// ./app.js
import { track } from './analytics'
track('Form Submitted', {
email: 'name@example.com',
name: 'Example Name',
dob: '01-01-1999'
})
// turns into
originalAnalytics.track('Form Submitted', {
email: 'r8Udt6Swa+Znk7CI5+9W/0xQ7PckBj3+H983fun8LEAtLFnzvJzeuq',
name: 'ckBj3+H983ful8KUHuKglyawtfeKLVf4EAN3XEkKhmX',
dob: 'xt5crfiZhr5M7IPcbb2q8f8uB/Et77q'
})
// ./init.js
import EncryptionClient from '@ume/client'
import analyticsEncryption from 'analytics-encryption'
const apiHost = process.env.UME_API_HOST
const eclient = new EncryptionClient({ apiHost })
analyticsEncryption({
replace: true,
local: { encrypt: eclient.encrypt.bind(eclient) }
})
// ./app.js
window.analytics.track('Form Submitted', {
email: 'name@example.com',
name: 'Example Name',
dob: '01-01-1999'
})
// turns into
window.analytics.original.track('Form Submitted', {
email: 'r8Udt6Swa+Znk7CI5+9W/0xQ7PckBj3+H983fun8LEAtLFnzvJzeuq',
name: 'ckBj3+H983ful8KUHuKglyawtfeKLVf4EAN3XEkKhmX',
dob: 'xt5crfiZhr5M7IPcbb2q8f8uB/Et77q'
})
All contributions are welcome, analytics-encryption
is MIT-licensed.
FAQs
Config-based encryption for analytics in JavaScript
The npm package analytics-encryption receives a total of 0 weekly downloads. As such, analytics-encryption popularity was classified as not popular.
We found that analytics-encryption demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.