hackbox-client

0.0.3 • Public • Published

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);

Package Sidebar

Install

npm i hackbox-client

Weekly Downloads

5

Version

0.0.3

License

MIT

Unpacked Size

3.43 kB

Total Files

4

Last publish

Collaborators

  • tomalama