Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ConnectionOptions

import type { ConnectionOptions } from "https://raw.githubusercontent.com/nats-io/nats.deno/v1.28.2/nats-base-client/internal_mod.ts";
interface ConnectionOptions {
authenticator?: Authenticator | Authenticator[];
debug?: boolean;
ignoreAuthErrorAbort?: boolean;
ignoreClusterUpdates?: boolean;
inboxPrefix?: string;
maxPingOut?: number;
maxReconnectAttempts?: number;
name?: string;
noAsyncTraces?: boolean;
noEcho?: boolean;
noRandomize?: boolean;
pass?: string;
pedantic?: boolean;
pingInterval?: number;
port?: number;
reconnect?: boolean;
reconnectDelayHandler?: () => number;
reconnectJitter?: number;
reconnectJitterTLS?: number;
reconnectTimeWait?: number;
resolve?: boolean;
servers?: Array<string> | string;
timeout?: number;
tls?: TlsOptions | null;
token?: string;
user?: string;
verbose?: boolean;
waitOnFirstConnect?: boolean;
}

§Properties

§
authenticator?: Authenticator | Authenticator[]
[src]

When the server requires authentication, set an Authenticator. An authenticator is created automatically for username/password and token authentication configurations if {@link user} and {@link pass} or the {@link token} options are set.

§
debug?: boolean
[src]

When set to true the client will print protocol messages that it receives or sends to the server.

§
ignoreAuthErrorAbort?: boolean
[src]

By default, NATS clients will abort reconnect if they fail authentication twice in a row with the same error, regardless of the reconnect policy. This option should be used with care as it will disable this behaviour when true

§
ignoreClusterUpdates?: boolean
[src]

When set to true, cluster information gossiped by the nats-server will not augment the lists of server(s) known by the client.

§
inboxPrefix?: string
[src]

A string prefix (must be a valid subject prefix) prepended to inboxes generated by client. This allows a client with limited subject permissions to specify a subject where requests can deliver responses.

§
maxPingOut?: number
[src]

Sets the maximum count of ping commands that can be awaiting a response before rasing a stale connection status {@link DebugEvents#StaleConnection} notification {@link NatsConnection#status} and initiating a reconnect.

§
maxReconnectAttempts?: number
[src]

Sets the maximum count of per-server reconnect attempts before giving up. Set to -1 to never give up.

§
name?: string
[src]

Sets the client name. When set, the server monitoring pages will display this name when referring to this client.

§
noAsyncTraces?: boolean
[src]

When true, the client will not augment timeout and other error traces with additional context as to where the operation was started.

§
noEcho?: boolean
[src]

When set to true, messages published by this client will not match this client's subscriptions, so the client is guaranteed to never receive self-published messages on a subject that it is listening on.

§
noRandomize?: boolean
[src]

If set to true, the client will not randomize its server connection list.

§
pass?: string
[src]

Sets the password for a client connection. Requires that the {@link user} option be set. See {@link authenticator}.

§
pedantic?: boolean
[src]

When set to true, the server may perform additional checks on protocol message requests. This option is only useful for NATS client development and shouldn't be used, as it affects server performance.

§
pingInterval?: number
[src]

Sets the number of milliseconds between client initiated ping commands. See {@link maxPingOut}.

§
port?: number
[src]

Sets the port number on the localhost (127.0.0.1) where the nats-server is running. This option is mutually exclusive with {@link servers}.

§
reconnect?: boolean
[src]

When set to true, the server will attempt to reconnect so long as {@link maxReconnectAttempts} doesn't prevent it.

§
reconnectDelayHandler?: () => number
[src]

Set a function that dynamically determines the number of milliseconds that the client should wait for the next reconnect attempt.

§
reconnectJitter?: number
[src]

Set the upper bound for a random delay in milliseconds added to {@link reconnectTimeWait}.

§
reconnectJitterTLS?: number
[src]

Set the upper bound for a random delay in milliseconds added to {@link reconnectTimeWait}. This only affects TLS connections

§
reconnectTimeWait?: number
[src]

Set the number of millisecods between reconnect attempts.

§
resolve?: boolean
[src]

When false, the connect function will not perform any hostname resolution. Note that by default this option will be true if the client supports hostname resolution. Note that on clients that don't supported (mainly the websocket client, setting this option to true, will throw an exception as this option is not available.

§
servers?: Array<string> | string
[src]

Set the hostport(s) where the client should attempt to connect. This option is mutually exclusive with {@link port}.

§
timeout?: number
[src]

Sets the number of milliseconds the client should wait for a server handshake to be established.

§
tls?: TlsOptions | null
[src]

When set (can be an empty object), the client requires a secure connection. TlsOptions honored depend on the runtime. Consult the specific NATS javascript client GitHub repo/documentation. When set to null, the client should fail should not connect using TLS. In the case where TLS is available on the server a standard connection will be used. If TLS is required, the connection will fail.

§
token?: string
[src]

Set to a client authentication token. Note that these tokens are a specific authentication strategy on the nats-server. This option is mutually exclusive of {@link user} and {@link pass}. See {@link authenticator}.

§
user?: string
[src]

Sets the username for a client connection. Requires that the {@link pass} option be set. See {@link authenticator}.

§
verbose?: boolean
[src]

When set to true, the server will send response to all server commands. This option is only useful for NATS client development and shouldn't be used, as it affects server performance.

§
waitOnFirstConnect?: boolean
[src]

When set to true {@link maxReconnectAttempts} will not trigger until the client has established one connection.