Skip to main content

Interface: ConnectionOptions


gRPC and Temporal Server connection options



Optional address: string

Server hostname and optional port. Port defaults to 7233 if address contains only host.




Optional apiKey: string | () => string

API key for Temporal. This becomes the "Authorization" HTTP header with "Bearer " prepended. This is mutually exclusive with the Authorization header in ConnectionOptions.metadata.

You may provide a static string or a callback. Also see Connection.withApiKey or Connection.setApiKey


Optional callCredentials: CallCredentials[]

gRPC call credentials.

CallCredentials generaly modify metadata; they can be attached to a connection to affect all method calls made using that connection. They can be created using some of the factory methods defined here

If callCredentials are specified, they will be composed with channel credentials (either the one created implicitely by using the tls option, or the one specified explicitly through credentials). Notice that gRPC doesn't allow registering callCredentials on insecure connections.


Optional channelArgs: ChannelOptions

GRPC Channel arguments


option descriptions here

By default the SDK sets the following keepalive arguments:

grpc.keepalive_permit_without_calls: 1
grpc.keepalive_time_ms: 30_000
grpc.keepalive_timeout_ms: 15_000

To opt-out of keepalive, override these keys with undefined.


Optional connectTimeout: Duration

Milliseconds to wait until establishing a connection with the server.

Used either when connecting eagerly with Connection.connect or calling Connection.ensureConnected.


number of milliseconds or ms-formatted string


10 seconds


Optional credentials: ChannelCredentials

gRPC channel credentials.

ChannelCredentials are things like SSL credentials that can be used to secure a connection. There may be only one ChannelCredentials. They can be created using some of the factory methods defined here

Specifying a prebuilt ChannelCredentials should only be required for advanced use cases. For simple TLS use cases, using the tls property is recommended. To register CallCredentials (eg. metadata-based authentication), use the callCredentials property.

Either tls or this may be specified for configuring TLS


Optional interceptors: Interceptor[]

gRPC interceptors which will be applied to every RPC call performed by this connection. By default, an interceptor will be included which automatically retries retryable errors. If you do not wish to perform automatic retries, set this to an empty list (or a list with your own interceptors). If you want to add your own interceptors while keeping the default retry behavior, add this to your list of interceptors: makeGrpcRetryInterceptor(defaultGrpcRetryOptions()). See:


Optional metadata: Metadata

Optional mapping of gRPC metadata (HTTP headers) to send with each request to the server. Setting the Authorization header is mutually exclusive with the apiKey option.

In order to dynamically set metadata, use Connection.withMetadata


Optional tls: null | boolean | TLSConfig

TLS configuration. Pass a falsy value to use a non-encrypted connection, or true or {} to connect with TLS without any customization.

For advanced scenario, a prebuilt grpc.ChannelCredentials object may instead be specified using the credentials property.

Either credentials or this may be specified for configuring TLS


TLS is disabled