Socket
Socket
Sign inDemoInstall

streamlabs-ws-client

Package Overview
Dependencies
28
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    streamlabs-ws-client

Unofficial Streamlabs Sockets API client library


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
2.11 MB
Created
Weekly downloads
 

Readme

Source

streamlabs-ws-client

Language Node Version Yarn Version Licence Info

Streamlabs Slack

Streamlabs Slack

Unofficial Streamlabs WebSocket API Client

  • 🎉 First class Typescript support
  • 📡 Real-time via socket.io-client
  • 👌 Simple un-opinionated API

Table of Contents

Installation

$ npm install --save streamlabs-ws-client

...
$ yarn add streamlabs-ws-client

...

Usage

const { StreamlabsClient } = require("../lib/index");

const debugEvents = [
    "connect",
    "connect_error",
    "connect_timeout",
    "disconnect",
    "error"
];

const streamlabsEvents = [
    "follow",
    "bits",
    "host",
    "raid",
    "merch",
    "subscription",
    "resubscription",
    "donation"
];

const token = "<INSERT STREAMLABS WS TOKEN>";

const client = new StreamlabsClient({
    token,
    emitTests: true,
    rawEvents: debugEvents
});

for (const debugEvent of debugEvents) {
    client.on(debugEvent, (data) => {
        console.debug(`[STREAMLABS-EVENT] Event: ${debugEvent}`, data);
    });
}

for (const streamEvent of streamlabsEvents) {
    client.on(streamEvent, async (data) => {
        console.info(`[STREAMLABS-EVENT] Event: ${streamEvent}`, JSON.stringify(data, null, 4));
    });
}

client.connect();

API

connect()

client.connect();

disconnect()

client.disconnect();

on()

client.on("event", (data: IStreamlabsWSEventMessage) => {
    // Do something
});

emit()

client.on("event", (data: IStreamlabsWSEventMessage) => {
    // TBC
});

Examples

TBC

Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

License

MIT : http://opensource.org/licenses/MIT

Author

Jarvis Prestidge | jarvisprestidge@gmail.com

Keywords

FAQs

Last updated on 12 Jan 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc