so-chat-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

sobot

Instructions

import { Client } from 'so-chat-client';

(async () => {
	const client = new Client({
		email: 'foo@bar.com',
		password: 'foobar',
		mainRoom: 17
	});

	client.once('open', () => console.log('Connected'));
	client.once('close', () => console.log('Connection closed'));
	client.on('error', error => console.error(error));
	client.on('event', event => console.log(event));
	client.on('debug', message => console.log(message));

	try {
		await client.auth(); // Authenticates with SO and sets up the client
		await client.join(); // If you don't pass an ID, it will join the room you passed into the config
	} catch (error) {
		console.error(error);
	}
})();

Readme

Keywords

none

Package Sidebar

Install

npm i so-chat-client

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

16.3 kB

Total Files

6

Last publish

Collaborators

  • xbenjii