1.0.3 • Published 1 year ago

client-socket-gateway v1.0.3

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

Using Client Socket Gateway

Library Installation

    npm install client-socket-gateway
  • This will install the library into your code and you can now use it

Library Usage

  • To use the library, import it in the file where your entry file is like this
    import { gateway } = require("client-socket-gateway")
  • Now initialize it
    // Requires socketUrl and clientId
    gateway.getResponse(socketUrl, clientId)
  • When you initialize it, ensure to pass the socketUrl, that is from your backend and the clientId so that your client can only receive specific messages.
  • Now you are able to receives messages and you can do so like below
    gateway.getResponse(socketUrl, clientId)
    .then((response) => {
        console.log(response)
    })
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago