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.
react-metrics-service
Advanced tools
React adapter for metrics services like Google Analytics, Tealium or Comcast.
React adapter for metrics services like Google Analytics, Tealium or Comcast.
WIP
First create your metrics-service module (eg. using google analytics) in the file my-metrics.js
:
// my-metrics.js
import { createClient, googleAnalytics } from 'react-metrics-service'
const client = createClient()
client.addMiddleware(googleAnalytics({ trackingID: 'UA-000000-01' }))
export default client
Add metricsServiceContext
high order component to your app root component:
import { metricsServiceContext } from 'react-metrics-service'
import myClient from 'my-metrics'
const App = (
// ... your app here
)
export default metricsServiceContext({ client: myClient })(App)
Then you can use one of the helper high order components like:
import { metricsServiceClick } from 'react-metrics-service'
import MyComponent from 'my-component.js'
export default metricsServiceClick('gaSend', 'event', 'Video', 'play')(MyComponent)
Or use the service directly like:
import myClient from 'my-metrics'
export default () => {
// ...
myClient.gaSend('event', 'Video', 'play')
// ...
}
First of all, thank you for wanting to help!
git checkout -b more_magic
npm test
git commit -am "Added more magic"
git push origin more_magic
FAQs
React adapter for metrics services like Google Analytics, Tealium or Comcast.
The npm package react-metrics-service receives a total of 0 weekly downloads. As such, react-metrics-service popularity was classified as not popular.
We found that react-metrics-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.