hackbox-client
v0.0.3
Published
A Jackbox inspired framework for creating party games - client component
Downloads
7
Maintainers
Readme
hackbox-client
A Jackbox inspired framework for creating party games - client component.
Usage
const hackboxClient = require("hackbox-client");
Hosting
async componentDidMount() {
const hackbox = await hackboxClient("http://localhost:8080");
const room = await hackbox.createRoom();
this.setState(() => ({ room }));
hackbox.onPlayerJoin(room => {
this.setState(() => ({ room }));
});
}
Joining a Room
const hackbox = await hackboxClient("http://localhost:8080");
const playerId = await hackbox.joinRoom(roomId, name);