@sorare/actioncable
v1.0.3
Published
WebSocket/ActionCable client for Sorare
Downloads
40
Maintainers
Keywords
Readme
@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: {
// 'Authorization': `Bearer <YourJWTorOAuthToken>`,
// 'APIKEY': '<YourOptionalAPIKey>'
},
});
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.