1.1.5 • Published 2 years ago
rdh-socket-client v1.1.5
RDH Socket Client
Installation
To install the RDH Socket Client package, run the following command in your command line:
npm i rdh-socket-clientUSAGE
import rdhClientSocket from 'rdh-socket-client';
// Initialize the client with your app ID and app key
const client = new rdhClientSocket({
app_id: 'APP_ID',
app_key: 'APP_key'
});
const client_first_channel = client.channel('channelName');
// Subscribe to a channel and listen for an event
client_first_channel.on('eventName', (data) => {
console.log(data.message);
});
// Emit a custom event with data
client_first_channel.emit('myEvent', mydata);eplace APP_ID and APP_key with your actual application ID and key. Make sure to customize the channel name, event name, and data according to your application's requirements.
Feel free to explore more features and options provided by the RDH Socket Client package documentation for a comprehensive understanding of its capabilities.