
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
stream-analytics
Advanced tools
Load the library asynchronously
<script type="text/javascript">
!function(a,b){a("StreamAnalytics","//d2j1fszo1axgmp.cloudfront.net/2.0.0/stream-analytics.min.js",b)}(function(a,b,c){var d,e,f;c["_"+a]={},c[a]=function(b){c["_"+a].clients=c["_"+a].clients||{},c["_"+a].clients[b.projectId]=this,this._config=b},d=["setUser","trackImpression","trackEngagement"];for(var g=0;g<d.length;g++){var h=d[g],i=function(a){return function(){return this["_"+a]=this["_"+a]||[],this["_"+a].push(arguments),this}};c[a].prototype[h]=i(h)}e=document.createElement("script"),e.async=!0,e.src=b,f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(e,f)},this);
</script>
var client = new StreamAnalytics({
apiKey: "API_KEY",
token: "ANALYTICS_TOKEN"
});
client.setUser('7b22b0b8-6bb0-11e5-9d70-feff819cdc9f');
Every activity (eg. messages) shown to the user should be tracked as an impression.
var impression = {
foreign_ids: ['message:34349698'],
feedId: 'user:ChartMill'
};
// track impression for two messages presented to the user
client.trackImpression(impression);
Every meaningful user interactions should be tracked with a label, optional extra information can be tracked as well.
engagement = {...}
// Sends one engagement event to the APIs
client.trackEngagement(engagement);
// Click on a message
var engagement = {
label: 'click',
foreignId: 'message:34349698',
feedId: 'user:ChartMill'
};
client.trackEngagement(engagement, function(){console.log(arguments);});
// Share message
var engagement = {
label: 'share',
foreignId: 'message:34349698',
feedId: 'user:ChartMill'
};
client.trackEngagement(engagement);
If necessary, you can send additional information about the data involved or the specific event. The features field must be a list of feature objects. A feature object is made of two mandatory fields: "group" and "value"
eg.
[{
'group': 'topic',
'value': 'coffee'
}]
A string representing the location of the content (eg. 'notification_feed')
A string representing the origin feed for the content
An integer that multiplies the score of the interaction (eg. 2 or -1)
When tracking interactions with content, it might be useful to provide the oridinal position (eg. 2)
The ID for the content as you store that in your database (or/and on Stream's feeds) (eg. 'user:42') (engagement only)
An Array of foreign_ids (impressions only)
The event identifier (eg. click, share, ...) this field is mandatory for every engagement event
FAQs
Analytics JS client for GetStream.io.
The npm package stream-analytics receives a total of 3,689 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.