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.
stream-analytics
Advanced tools
# via npm
$ npm install stream-analytics
# or bower
$ bower install stream-analytics
Or load the library from our CDN:
<script src="https://xxx.cloudfront.net/..." type="text/javascript"></script>
var client = new StreamAnalytics({
projectId: "YOUR_PROJECT_ID",
writeKey: "YOUR_WRITE_KEY"
});
Every activity (eg. messages) shown to the user should be tracked as an impression
var impression = {
viewerId: 'user:Thierry',
activityId: 'message:34349698',
feedId: 'user:ChartMill',
timestamp: new Date().toISOString() // optional
};
// sends an impression to the APIs
client.trackImpression(impression);
// sends multilple impressions to the APIs in one request
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 modifier) for the engagement. modifier 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 modifier 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.trackEngagementEvent(engagement);
// Sends multiple engagement events to the APIs in one request
client.trackEngagementEvents(engagements);
// Click on a message
var engagement = {
engagement: {
label: 'click',
modifier: 10
},
userId: 'user:Thierry',
activityId: 'message:34349698',
sourceFeedId: 'user:ChartMill',
timestamp: new Date().toISOString() // optional
};
client.trackEngagementEvent(engagement);
// Share message
var engagement = {
engagement: {
label: 'share',
modifier: 100
},
userId: 'user:Thierry',
activityId: 'message:34349698',
feedId: 'user:ChartMill',
timestamp: new Date().toISOString() // optional
};
client.trackEngagementEvent(engagement);
this allows for storing extra information about users such as public profile IDs
var userData = {
userId: 'user:Thierry',
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.
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.