
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
A little library to simplify event tracking in React components.
Set it up in your bootstrap:
var myTracker = require('awesomeTracker');
var retracked = require('retracked');
var recordingFn = (fullEventKey, values) =>
myTracker.record(fullEventKey, values);
// event types that we track
var actionNames = [
'view',
'click', // or tap
'hover',
'scroll',
'swipe',
'pinch',
'expand',
];
retracked.setup(recordingFn, actionNames);
Then in your components you can namespace the event tracking by context:
var AboutApp = React.createClass({
childContextTypes: {
track: React.PropTypes.func,
},
getChildContext: function() {
return {
track: Retracked.makeTracker({
namespace: 'about'
})
};
},
render: function() {
return (
<div>
<JobsPage />
</div>
);
}
});
Then you can use that anywhere down the ownership hierarchy:
var JobsPage = React.createClass({
contextTypes: {
track: React.PropTypes.func.isRequired
},
componentDidMount: function() {
// track this event right now
this.context.track('view.jobs');
}
render: function() {
return (
<div>
{/* curried function to track when a click happens */}
<button label="Apply" onClick={this.context.track.handle('click.apply')} />
</div>
);
}
});
This package contains a component, TrackedLink
, that abstracts away defining links on which you want
to track clicks, so that they fire events both in regular client-side rendering and also from server-side
rendered HTML before the full Javascript assets have downloaded and the full components have mounted.
For example,
<TrackedLink
className="open-in-app btn"
to={appStoreUrl}
trackingName="download_app"
>
Download our App
</TrackedLink>
FAQs
Isomorphic event and link tracking for React
We found that retracked 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
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.