Skip to content

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> dev

Getting 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, …) via app.on(eventName).

Message Handling

  • Schema Validation — TypeBox and zod payload validation, plus onError for failed messages.
  • MQTT 5 RPC — request/response over MQTT 5 using the in-memory TestBroker from @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 + inflight gauges wired into prom-client.
  • Custom Logger — plug a JSON-line logger into app.logger() and watch all framework-emitted warn/error flow through it.

Released under the MIT License.