0.1.2 • Published 3 years ago

dogehouse-js v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

NPM Package

Installation

  1. Go to https://dogehouse.tv
  2. Open Developer options (F12 or Ctrl+Shift+I)
  3. Go to Application > Local Storage > dogehouse.tv
  4. Copy your token and refresh-token and put them in an .env file:
DOGEHOUSE_TOKEN=<token>
DOGEHOUSE_REFRESH_TOKEN=<refresh-token>
  1. Install NodeJS and NPM.

Wrapper

The goal of the Wrapper is to provide premade functions for your ease.

  • All examples like, sending messages, joining rooms and more are in /examples.

Example - Get Popular Rooms

const { raw: { connect }, wrap } = require('dogehouse-js');

const main = async () => {
  try {
    const connection = await connect(
      process.env.DOGEHOUSE_TOKEN,
      process.env.DOGEHOUSE_REFRESH_TOKEN,
      {
        onConnectionTaken: () => {
          console.error('Another web socket connection has been opened. This usally means that you have logged in from somewhere else.');
        }
      }
    );

    const wrapper = wrap(connection);
    
    const rooms = await wrapper.getTopPublicRooms();
  } catch(e) {
    if(e.code === 4001) console.error("invalid token!");
  }
};

main();

Credits

Original author and implementation: Ilya Maximov mail@overlisted.net (https://overlisted.net) https://github.com/overlisted Thank you to Abalon#2525/https://github.com/alon-abadi for the awesome logo!

0.1.2

3 years ago

0.1.0

3 years ago

0.1.1

3 years ago