@asyx/mqtt-client
v0.1.0
Published
Asyx MQTT client layer: client-only TopicMap & Policy on top of @asyx/mqtt-core.
Readme
@asyx/mqtt-client
Client-only MQTT layer on top of @asyx/mqtt-core. Provides:
- TopicMap for client control stream (subscribe-only)
- Policy that blocks publishes by default
- AsyxMqttClient wrapper to subscribe and receive control messages
Install
npm i @asyx/mqtt-core @asyx/mqtt-clientBasics
import { MemoryTransport } from "@asyx/mqtt-core/dist/testing/MemoryTransport.js";
import { AsyxMqttClient } from "@asyx/mqtt-client";
const t = new MemoryTransport();
const client = new AsyxMqttClient(t, { tenantId: "t1", clientId: "cli_X" });
await client.core.connect({ clientId: "cli_X" });
await client.subscribeControl();
client.onMessage((m) => {
console.log("control:", m.topic, new TextDecoder().decode(m.payload));
});No broker endpoints or relay topic strings are shipped here. This package is OSS-safe and subscribe-only by default.
