OptionalmaxOptionalmaxMax reconnect attempts (-1 = unlimited, default). After exhaustion, the connection emits an error.
OptionalnameClient name shown in NATS monitoring UI
OptionalonCalled when a message cannot be decoded or validated. If not set, decode errors are logged to console.warn.
OptionalonCalled when a handler throws. If not set, handler errors are re-thrown, propagating up to the NATS connection error event.
IMPORTANT: For the veto critical path, always set this to a handler that triggers your swarm halt logic regardless of the primary handler's result.
OptionalpasswordNATS server URL(s). nats:// — TCP (cleartext — not for production) tls:// — TCP + TLS wss:// — WebSocket + TLS (browser-friendly) ws:// — WebSocket cleartext (dev only)
OptionaltlsTLS configuration. Required for tls:// or nats:// with TLS.
OptionaltokenBearer token auth
OptionalusernameUsername/password auth
Max payload size in bytes (default: 1 MB). Messages exceeding this are rejected.