Node.js Example
Install socket.io for Node:
npm i socket.io-client
The example below creates a socket.io client, connects to our server and prints all articles as they are received.
const io = require('socket.io-client');
const apikey = 'your-api-key';
const socket = io.connect('http://stream.newsfilter.io?apiKey=' + apikey);
socket.on('connect', function () {
console.log('connected');
});
socket.on('articles', function (articles) {
console.log(articles);
});