JavaScript WebSocket Client for Sorare
@sorare/actioncable
WebSocket/ActionCable client for Sorare.
Getting Started
npm install @sorare/actioncable --save
const { ActionCable } = require('@sorare/actioncable');
const cable = new ActionCable({
url: 'wss://ws.sorare.com/cable',
headers: {
},
});
cable.subscribe('aCardWasUpdated { id }', {
connected() {
console.log('connected');
},
disconnected() {
console.log('disconnected');
},
rejected() {
console.log('rejected');
},
received(data) {
console.log('received');
console.log(data);
},
});
License
@sorare/actioncable
is MIT licensed. Credits to ZackMattor/actioncable-nodejs for the initial work.