Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
heap-io-nodejs
Advanced tools
A simple wrapper around the Heap.io API for Node.js. This lets you track server-side events in Heap.io.
Strongly typed with TypeScript.
See API docs here: https://developers.heap.io/reference/server-side-apis-overview
npm install heap-io-nodejs
(async () => {
// Initialize the Heap client with your App ID
const heapClient = new HeapClient('YOUR_HEAP_APP_ID');
// Track an event
try {
const trackResponse = await heapClient.track({
// Recommend getting this from the client: window.heap.identity
identity: 'user_123',
event: 'Purchase Completed',
properties: {
amount: 99.99,
currency: 'USD',
},
timestamp: Date.now(),
});
console.log('Event tracked successfully:', trackResponse.status);
} catch (error) {
console.error('Failed to track event:', error);
}
// Add user properties
try {
const userPropsResponse = await heapClient.addUserProperties({
identity: 'user_123',
properties: {
email: 'user@example.com',
firstName: 'Jane',
lastName: 'Doe',
},
});
console.log('User properties added successfully:', userPropsResponse.status);
} catch (error) {
console.error('Failed to add user properties:', error);
}
})();
appId
(string): Your Heap.io App ID. Required.logger
(Logger): A logger instance if you want to pass your own custom logger. Optional. Default: console
.FAQs
A Node.js client for Heap.io
We found that heap-io-nodejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.