v0.1.0-alpha.0 — initial alpha release
Pre-release
Pre-release
First public alpha of nuxt-nats — NATS JetStream integration for Nuxt 4 / Nitro.
Install
```bash
npm install nuxt-nats@alpha
```
What's included
- JetStream publish (`jsPublish`) with JSON encoding, retry, and `Nats-Msg-Id` deduplication
- Core publish (`corePublish`) — fire-and-forget for metrics / ephemeral events
- Pull consumers (`defineNatsConsumer`) with `ackWait` heartbeats, configurable backoff, and dead-letter routing
- KV store (`useKV`) with per-bucket caching
- Object Store (`useObj`) for streaming large blobs through Nitro handlers
- Stream auto-provisioning on startup
- Health endpoint at `/api/_nats/health` — connection status, RTT, JetStream account stats
- Typed subjects via the `NatsEvents` module-augmentation interface
- Graceful drain on SIGTERM/SIGINT (works around nitrojs/nitro#4015)
- Bun-ready — auto-detects Bun runtime and uses WebSocket transport
- TLS / mTLS wired through module options
- Auth priority: nkey > token > user/pass
Requirements
- Nuxt `>= 3.0.0`
- Node.js `>= 20` (or Bun)
- NATS Server `>= 2.10` with JetStream enabled
Stability
This is a 0.x alpha. Public APIs (`jsPublish`, `defineNatsConsumer`, `useKV`, `useObj`, module options) are stable enough to use; breaking changes are possible before `1.0.0` but will be documented in the changelog.
Tests
19 unit tests + 26 integration tests passing against NATS 2.10 (Testcontainers).
Built against
- `@nats-io/*` v3.4.0 (the current v3 modular packages from nats-io/nats.js)