Examples
Runnable examples live in examples/. Every example uses workspace dependencies, so a single bun install at the repo root is enough.
bash
bun install
bun run --cwd examples/<name> devGetting Started
- Aedes Basic (TCP) — minimal TCP broker with username auth, audit middleware, and a publish-policy route.
- Aedes WebSocket — same shape but exposes MQTT over WebSocket only.
- Lifecycle Events — subscribe to broker-level events (
client,publish,subscribe, …) viaapp.on(eventName).
Message Handling
- Schema Validation — TypeBox and zod payload validation, plus
onErrorfor failed messages. - MQTT 5 RPC — request/response over MQTT 5 using the in-memory
TestBrokerfrom@mqttkit/core/testing.
Integration
- Service Push — push notifications from a business service into MQTT topics.
- Kafka Bridge — bidirectional bridge between MQTT and Kafka, both directions.
- AsyncAPI Standalone — generate AsyncAPI 3.0 + browsable HTML on its own HTTP server.
- AsyncAPI + Elysia — share a single Node http.Server between MQTT-over-WS and an Elysia HTTP app.
Observability
- Prometheus Metrics — full
onMetric+onError+inflightgauges wired intoprom-client. - Custom Logger — plug a JSON-line logger into
app.logger()and watch all framework-emitted warn/error flow through it.