Skip to content

sorare/actioncable

Repository files navigation

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:https://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.

About

WebSocket/ActionCable client for Sorare

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published