Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@expo/rudder-sdk-node
Advanced tools
RudderStack is a customer data pipeline tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse.
More information on RudderStack can be found here.
RudderStack’s Node.js SDK allows you to track your customer event data from your Node.js code. Once enabled, the event requests hit the RudderStack servers. RudderStack then routes the events to the specified destination platforms as configured by you.
$ npm install @rudderstack/rudder-sdk-node
const Analytics = require("@rudderstack/rudder-sdk-node");
// we need the batch endpoint of the Rudder server you are running
const client = new Analytics("write key", "<data-plane-uri>/v1/batch");
client.track({
event: "event name",
userId: "user id"
});
const client = new Analytics(
"write_key",
"server_url/v1/batch",
{
flushAt: <number> = 20,
flushInterval: <ms> = 20000
maxInternalQueueSize: <number> = 20000 // the max number of elements that the SDK can hold in memory,
// this is different than the Redis list created when persistence is enabled
}
);
client.createPersistenceQueue({ redisOpts: { host: "localhost" } }, err => {})
Adding a method createPersistenceQueue which takes as input two params queueOpts and a callback
QueueOpts {
queueName ?: string = rudderEventsQueue,
isMultiProcessor ? : boolean = false
prefix ? : string = {rudder}, // pass a value without the {}
redisOpts : RedisOpts,
jobOpts ?: JobOpts
}
https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md#queue
RedisOpts {
port?: number = 6379;
host?: string = localhost;
db?: number = 0;
password?: string;
}
JobOpts {
maxAttempts ? : number = 10
}
callback: function(error) || function() // createPersistenceQueue calls this with error or nothing(in case of success), user
// should retry in case of error
The createPersistenceQueue method will initialize a Redis list by calling Bull's utility methods. It will also add a single job processor for processing(making requests to Rudder server) jobs that are pushed into the list. Before adding a processor, the SDK will remove the last active job(should be at max 1 active) if any and push it to be processed again in order. Error in doing this will lead to calling the callback with error parameter. Retry calling createPersistenceQueue with backoff.
If the createPersistenceQueue method is not called after initialising the SDK by the user, the SDK will work with no persistence and the behaviour will be same as at present.
https://gitter.im/OptimalBits/bull/archives/2018/04/17 Details: https://redis.io/topics/cluster-tutorial#redis-cluster-data-sharding Workaround: https://gitter.im/OptimalBits/bull/archives/2018/04/17, we are passing a prefix with default {rudder}
Documentation is available here.
If you come across any issues while configuring or using the RudderStack Node.js SDK, please feel free to contact us or start a conversation on our Slack channel. We will be happy to help you.
FAQs
Compact fork of rudder-node-sdk
We found that @expo/rudder-sdk-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 24 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.