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.
twitch-webhook
Advanced tools
Little Node.js module to interact with new Twitch Helix API Webhooks.
npm install --save twitch-webhook
const TwitchWebhook = require('twitch-webhook')
const twitchWebhook = new TwitchWebhook({
client_id: 'Your Twitch Client ID',
callback: 'Your Callback URL',
secret: 'It\'s a secret', // default: false
lease_seconds: 259200, // default: 864000 (maximum value)
listen: {
port: 8080, // default: 8443
host: '127.0.0.1', // default: 0.0.0.0
autoStart: false // default: true
}
})
// set listener for all topics
twitchWebhook.on('*', ({ topic, options, endpoint, event }) => {
// topic name, for example "stream"
console.log(topic)
// topic options, for example "{user_id: 12826}"
console.log(options)
// full topic URL, for example
// "https://api.twitch.tv/helix/streams?user_id=12826"
console.log(endpoint)
// topic data
console.log(event)
})
// set listener for topic
twitchWebhook.on('users/follows', ({ event }) => {
console.log(event)
})
// subscribe to topic
twitchWebhook.subscribe('users/follows', {
from_id: 12826 // ID of Twitch Channel ¯\_(ツ)_/¯
})
// renew the subscription when it expires
twitchWebhook.on('unsubscibe', (obj) => {
twitchWebhook.subscribe(obj['hub.topic'])
})
// tell Twitch that we no longer listen
// otherwise it will try to send events to a down app
process.on('SIGINT', () => {
// unsubscribe from all topics
twitchWebhook.unsubscribe('*')
// or unsubscribe from each one individually
twitchWebhook.unsubscribe('users/follows', {
to_id: 12826
})
process.exit(0)
})
FAQs
A Node JS library for new Twitch Helix API Webhooks
The npm package twitch-webhook receives a total of 4 weekly downloads. As such, twitch-webhook popularity was classified as not popular.
We found that twitch-webhook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.