انتقل إلى المحتوى الرئيسي

Function: connectNats()

connectNats(options): Promise<NatsConnection>

Defined in: packages/messaging/src/nats.ts:91

Connects to the broker as one principal, authenticating with its nkey. The seed is read from the secret store by reference, held only for the handshake and the authenticator's life, and never logged. Replies, and JetStream's acknowledgements and pull deliveries, arrive under the principal's own inbox prefix (see inboxPrefix in @oktoid/contracts), never the shared _INBOX.

Parameters​

options​

ConnectNatsOptions

Returns​

Promise<NatsConnection>

A connection to pass to natsWire.

Throws​

The reference does not resolve.