Static
new_For API compatibility with the native version. Does not set up mTLS.
Rest
...args: any[]a new websocket connection builder object with default TLS configuration
Static
new_For API compatibility with the native version. Alias for new_builder_for_websocket.
a new websocket connection builder object with default TLS configuration
Static
new_For API compatibility with the native version. Alias for new_with_websockets.
Rest
...args: any[]a new websocket connection builder object with default TLS configuration
Static
new_For API compatibility with the native version. Alias for new_builder_for_websocket.
Rest
...args: any[]a new websocket connection builder object with default TLS configuration
Static
new_Creates a new builder using MQTT over websockets (the only option in browser)
a new websocket connection builder object with default TLS configuration
Configures the IoT endpoint for this connection
The IoT endpoint to connect to
this builder object
The client id to use for this connection
The client id to use for this connection
this builder object
The port to connect to on the IoT endpoint
The port to connect to on the IoT endpoint. Usually 8883 for MQTT, or 443 for websockets
this builder object
Determines whether or not the service should try to resume prior subscriptions, if it has any
true if the session should drop prior subscriptions when this client connects, false to resume the session
this builder object
Configures the connection to use MQTT over websockets. No-op in the browser.
this builder object
Configures MQTT keep-alive via PING messages. Note that this is not TCP keepalive.
How often in seconds to send an MQTT PING message to the service to keep the connection alive
this builder object
Configures the TCP socket timeout (in milliseconds)
TCP socket timeout
this builder object
in favor of socket options
Configures the PINGREQ response timeout (in milliseconds)
PINGREQ response timeout
this builder object
Configures the will message to be sent when this client disconnects
The will topic, qos, and message
this builder object
Configures the common settings for the socket to use when opening a connection to the server
The socket settings
this builder object
Allows additional headers to be sent when establishing a websocket connection. Useful for custom authentication.
Additional headers to send during websocket connect
this builder object
Configures Static AWS credentials for this connection. Please note that the static credential will fail when the web session expired.
The service region to connect to
IAM Access ID
IAM Secret Key
Optional
aws_sts_token: stringsession credentials token (optional)
this builder object
Configures credentials provider (currently support for AWS Cognito Credential Provider) for this connection
credential provider used to update credential when session expired (optional)
this builder object
Sets the custom authorizer settings. This function will modify the username, port, and TLS options.
The username to use with the custom authorizer. If an empty string is passed, it will check to see if a username has already been set (via WithUsername function). If no username is set then no username will be passed with the MQTT connection.
The name of the custom authorizer. If an empty string is passed, then 'x-amz-customauthorizer-name' will not be added with the MQTT connection. It is strongly recommended to URL-encode this value; the SDK will not do so for you.
The signature of the custom authorizer. If an empty string is passed, then 'x-amz-customauthorizer-signature' will not be added with the MQTT connection. The signature must be based on the private key associated with the custom authorizer. The signature must be base64 encoded. Required if the custom authorizer has signing enabled.
The password to use with the custom authorizer. If null is passed, then no password will be set.
Optional
token_key_name: stringKey used to extract the custom authorizer token from MQTT username query-string properties. Required if the custom authorizer has signing enabled. It is strongly suggested to URL-encode this value; the SDK will not do so for you.
Optional
token_value: stringAn opaque token value. Required if the custom authorizer has signing enabled. This value must be signed by the private key associated with the custom authorizer and the result placed in the authorizer_signature argument.
Sets username for the connection
the username that will be passed with the MQTT connection
Sets password for the connection
the password that will be passed with the MQTT connection
Configure the max reconnection period (in second). The reconnection period will be set in range of [reconnect_min_sec,reconnect_max_sec].
max reconnection period
Configure the min reconnection period (in second). The reconnection period will be set in range of [reconnect_min_sec,reconnect_max_sec].
min reconnection period
Returns the configured MqttConnectionConfig
The configured MqttConnectionConfig
Generated using TypeDoc
Builder functions to create a MqttConnectionConfig which can then be used to create a MqttClientConnection, configured for use with AWS IoT.