@sgrs/client-ts
    Preparing search index...

    Interface NatsConfig

    interface NatsConfig {
        maxPayloadBytes?: number;
        maxReconnectAttempts?: number;
        name?: string;
        onDecodeError?: (err: EventValidationError) => void;
        onHandlerError?: (err: unknown, event: SgrsEvent, subject: string) => void;
        password?: string;
        servers: string | string[];
        tls?: TLSConfig;
        token?: string;
        username?: string;
    }
    Index
    maxPayloadBytes?: number

    Max payload size in bytes (default: 1 MB). Messages exceeding this are rejected.

    maxReconnectAttempts?: number

    Max reconnect attempts (-1 = unlimited, default). After exhaustion, the connection emits an error.

    name?: string

    Client name shown in NATS monitoring UI

    onDecodeError?: (err: EventValidationError) => void

    Called when a message cannot be decoded or validated. If not set, decode errors are logged to console.warn.

    onHandlerError?: (err: unknown, event: SgrsEvent, subject: string) => void

    Called 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.

    password?: string
    servers: string | string[]

    NATS server URL(s). nats:// — TCP (cleartext — not for production) tls:// — TCP + TLS wss:// — WebSocket + TLS (browser-friendly) ws:// — WebSocket cleartext (dev only)

    tls?: TLSConfig

    TLS configuration. Required for tls:// or nats:// with TLS.

    token?: string

    Bearer token auth

    username?: string

    Username/password auth