@cloudws/node-api
v0.1.1
Published
Node.js server CLoudWS API
Downloads
2
Readme
CloudWS Node.js lib
Installation
npm install cloudws-node-api
or
yarn add cloudws-node-api
Getting started
import CloudWS from '@cloudws/node-api';
const cloudWS = new CloudWS(process.env.CLOUDWS_TOKEN);
Create channel
cloudWS.createChannel('my_channel')
Get list of channels
cloudWS.getAllChannels();
Send message
cloudWS.sendMessage('my_channel', {data: 'Message to channel'});
Delete message
cloudWS.deleteChannel('my_channel');
Example
import CloudWS from '@cloudws/node-api';
const cloudWS = new CloudWSAPI(process.env.CLOUDWS_TOKEN);
const start = async () => {
await cloudWS.createChannel('my_channel');
await cloudWS.sendMessage('my_channel', {data: 'Message to channel'});
await cloudWS.deleteChannel('my_channel');
};
start();