New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@mysetup/mqtt

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mysetup/mqtt

MQTT client helpers for Node.js applications.

latest
npmnpm
Version
2.0.10
Version published
Maintainers
1
Created
Source

@mysetup/mqtt

MQTT helpers for creating connections, subscribing, publishing, and reusing clients.

Installation

pnpm add @mysetup/mqtt

Supported libraries and runtimes

SupportedNotes
Node.jsFull support
Next.js server runtimeSupported in backend-only usage
Browser appsNot supported

Usage

import {
    mqttCreateConnection,
    mqttDisconnect,
    mqttPublish,
    mqttSub,
} from "@mysetup/mqtt";

const clientId = "app-client";
const config = {
    protocol: "mqtt",
    host: "localhost",
    port: 1883,
    path: "",
};

mqttCreateConnection({
    clientId,
    config,
    topicList: ["updates/topic"],
    messageCallback: (topic, payload) => {
        console.log(topic, payload);
    },
    environment: "development",
});

mqttSub(["updates/topic"], clientId);
mqttPublish("updates/topic", { hello: "world" }, clientId);
mqttDisconnect(
    {
        clientId,
        config,
        topicList: ["updates/topic"],
        messageCallback: () => {},
    },
    false,
);

Exports

  • mqttCreateConnection
  • mqttSub
  • mqttUnSub
  • mqttPublish
  • mqttDisconnect
  • getMqttClient
  • removeMqttClient

Keywords

mqtt

FAQs

Package last updated on 15 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts