Chips Casino

The following pages contain information on all the technical details of the chips framework and its services. We use a websocket transport for communication between server and client.

Getting Started

yarn add @chipsgg/openservice-ws-client
// ES5
const WebSocket = require("ws");
const Client = require("@chipsgg/openservice-ws-client");

//ES6 - browser
//websockets must be supported in browser
import Client from "@chipsgg/openservice-ws-client";

const channels = ["public", "private", "auth", "community"];

Client(WebSocket, { channels }).then(async ({ state, actions }) => {
    // do somthing  

    await actions.public('echo', { message: 'hello world!' })
        .then(console.log)
        .catch(console.error)

    await actions.community('on', { topic: 'chats', path: ['public'] })

    state.on('community.chats.public', console.log)
})