@socket-lync/js-client

1.0.0-alpha.2 • Public • Published

Installation

$ npm install @socket-lync/js-client

Usage

Example:

import SocketLync from '@socket-lync/js-client';

const socketLync = new SocketLync({
	client: io,
	socketOptions: {
		host: 'wss://ws.derpierre65.dev/app/APP-ID',
		reconnection: true,
		reconnectionDelayMax: 2_500,
		timeout: 10_000,
	},
});

socketLync.privateChannel('MyPrivateChannel.1312')
	.subscribed(() => console.log('PrivateChannel subscribed'))
	.listen('Notification', () => console.log('New Notification (private)'));

socketLync.channel('MyPublicChannel.1337')
          .subscribed(() => console.log('Channel subscribed'))
          .listen('Notification', () => console.log('New Notification (public)'));

socketLync.presenceChannel('MyPresenceChannel.42')
          .here((members) => console.log('PresenceChannel subscribed, members:', members))
          .listen('Notification', () => console.log('New Notification (presence)'));

Readme

Keywords

none

Package Sidebar

Install

npm i @socket-lync/js-client

Weekly Downloads

1

Version

1.0.0-alpha.2

License

MIT

Unpacked Size

35.5 kB

Total Files

8

Last publish

Collaborators

  • derpierre65