4.0.0 • Published 1 year ago

@chipsgg/openservice-ws-client v4.0.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Openservice Websocket Client

Websocket client for openservice-ws-server.

Install

yarn add @chipsgg/openservice-ws-client

Geting Started

import Client from "@chipsgg/openservice-ws-client";

//websockets must be supported in browser

//your action/state channels, this is dependent on your server implementation
const channels = [
  "public",
  "private",
  "auth",
]

let { actions, connect } = await Client(
    WebSocket,
    {
      host: host || process.env.SOCKET,
      channels,
      keepAlive: 1000,
    },
    (type, state) => {
      console.log('socket.event', type, state)
    }
  )

API

actions

RPC interface for server actions api.

actions.public.ping()
  .then(console.log)
  .catch(console.error)
4.0.0

1 year ago

2.0.0

2 years ago

1.0.34

3 years ago

1.0.19

4 years ago

2.1.2

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

2.1.0

5 years ago

1.0.23

4 years ago

1.0.29

3 years ago

1.0.28

3 years ago

3.2.0

4 years ago

1.0.27

3 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

2.0.13

5 years ago

2.0.12

5 years ago

2.0.11

5 years ago

2.0.10

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago