stackmq
v2.0.0
Published
Tools for developers to implement real-time messaging
Downloads
112
Keywords
Readme
stackmq
Tools for developers to implement real-time messaging
Getting started
npm install stackmq
Example
import { Stackmq } from "stackmq";
const connectionData = `<your_connection_data>`;
const stackmq = new Stackmq(connectionData);
stackmq
.onMessage((message) => {
console.log(message);
})
.onError((error) => {
console.log({ error });
});
Api
Stackmq()
Stackmq(connectionData)
Creates a new stackmq connection
connectionData
: The connection string to the stackmq. It should be the in the formatconst connectionData={ client_id: <your_client_id>; host: <your_host>; mqtts_port: <your_mqtts_port>; password: <your_password>; sub_topic: <your_sub_topic>; username: <your_username>; wss_port: <your_wss_port>; }