@easy-chat/chat-client
v0.0.3
Published
Chat Client for easy chat node js library
Downloads
4
Maintainers
Readme
easy-chat-client
Features
easy-chat implements real-time bidirectional event-based communication. It consists of:
- a Javascript client library (this repository)
- a Node Js Server for the browser (or a Node.js client)
Its main features are:
Reliability
Connections are established even in the presence of:
- proxies and load balancers.
- personal firewall and antivirus software.
For this purpose, it relies on socket io, which first establishes connection to the backend server using the best possible transports.
Minimalistic chat implementation support
You do not need to understand the internal structures and operation of websockets and chat systems. All you need to do is call create a room, heck you not need to destroy a room as this is handled intelligently and automatically;
Simple and convenient API
Sample code:
import { initEasyChat } from "@easy-chat/chat-client";
const { easyChatClient, easyChatController } = initEasyChat(
url, // server url
userId, // current user uniques, its is importnat that this stays unique throughout your application
userNames, // user names
userPhotoUrl // absolute file url for the user photo
);
Installation
// with npm
npm install @easy-chat/chat-client
// with yarn
yarn add @easy-chat/chat-client
How to use
The following example inits easy-chat-client and gets the chat client and chat controller instances.
import { initEasyChat } from "@easy-chat/chat-client";
const { easyChatClient, easyChatController } = initEasyChat(
url, // web socket server url
userId, // current user uniques, its is importnat that this stays unique throughout your application
userNames, // user names probably from the users profile
userPhotoUrl // absolute file url for the user photo
);
// create a new room
easyChatController.newRoom("id");
// and send message
easyChatController.send("hello world");
Documentation
The source code of the website can be found here. Contributions are welcome!
Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site.