0.1.2 • Published 3 years ago
dogehouse-js v0.1.2
NPM Package
Installation
- Go to https://dogehouse.tv
- Open Developer options (F12 or Ctrl+Shift+I)
- Go to Application > Local Storage > dogehouse.tv
- Copy your token and refresh-token and put them in an .env file:
DOGEHOUSE_TOKEN=<token>
DOGEHOUSE_REFRESH_TOKEN=<refresh-token>
- 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!