
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
stream-analytics
Advanced tools
# via npm
$ npm install stream-analytics
Or load the library from our CDN:
<script src="//d2j1fszo1axgmp.cloudfront.net/1.3.0/stream-analytics.min.js" type="text/javascript"></script>
var client = new StreamAnalytics({
projectId: "YOUR_PROJECT_ID",
writeKey: "YOUR_WRITE_KEY"
});
client.setUser('user:Thierry');
Every activity (eg. messages) shown to the user should be tracked as an impression.
var impression = {
activityIds: ['message:34349698', 'message:34349699'],
feedId: 'user:ChartMill'
};
// track impression for two messages presented to the user
client.trackImpression(impression);
Every meaningful user interactions should be tracked with content (activity_id) and source (sourceFeedId) information and provide a label and a score (the score) for the engagement. score is a signed integer. Positive values boost source and content for the user that trigger the engagement, negative values work as a discount for the same context. The value of the score can be used to differentiate engagements according to their importants (eg. sharing a message is probably more important than just clicking it).
engagement = {...}
// Sends one engagement event to the APIs
client.trackEngagement(engagement);
// Click on a message
var engagement = {
label: 'click',
score: 10,
activityId: 'message:34349698',
feedId: 'user:ChartMill',
};
client.trackEngagement(engagement);
// Share message
var engagement = {
label: 'share',
score: 100,
activityId: 'message:34349698',
feedId: 'user:ChartMill',
};
client.trackEngagement(engagement);
this allows for storing extra information about the current user such as public profiles
var userData = {
twitterId: '15875029',
facebookId: '784785430'
};
client.updateUserData(userData);
FAQs
Analytics JS client for GetStream.io.
The npm package stream-analytics receives a total of 2,558 weekly downloads. As such, stream-analytics popularity was classified as popular.
We found that stream-analytics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.