How to listen to real-time Radians socket events

This snippet below is enough to listen to socket events with The current events which are broadcasted are ‘block.applied’, ‘transaction.applied’, ‘scooter.registered’, ‘scooter.rental.start’, and ‘scooter.rental.finish’. Contact us if you need more events.

const socket = io('', {
     transports: ['websocket']
socket.on('connect', function() {
     console.log('Connected to Radians!');
socket.on('error', function(data) {
socket.on('block.applied', function(data) {

The snippet above results in: