Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
stream-analytics
Advanced tools
# via npm
$ npm install stream-analytics
Or load the library from our CDN:
<script src="//d2j1fszo1axgmp.cloudfront.net/latest/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 impressions for two messages presented to the user
client.trackImpressions(impressions);
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.trackEngagementEvent(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 4,098 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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.