Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sugo-client-auth

realglobe-inc7Apache-2.02.0.1

Authorize sugo-client

SUGOS

readme

sugo-client-auth

Build Status npm Version JS Standard

Authorize sugo-client

Installation

$ npm install sugo-client-auth --save

Usage

'use strict'

const co = require('co')
const { authorize } = require('sugo-client-auth')
const sgSocketClient = require('sg-socket-client')

co(function * () {
  let socket = sgSocketClient('http://localhost:3000')
  yield socket.waitToConnect()
  yield authorize(socket, {
    token: 'mytoken'
  })
  /* ... */
  socket.disconnect()
  yield socket.waitToDisconnect()
}).catch((err) => console.error(err))

Functions

Available functions

Signature Description
authorize(socket, auth) -> Promise Authorize socket

License

This software is released under the Apache-2.0 License.