Class AwsIotMqttConnectionConfigBuilder

Builder functions to create a MqttConnectionConfig which can then be used to create a MqttClientConnection, configured for use with AWS IoT.

Hierarchy

  • AwsIotMqttConnectionConfigBuilder

Methods

  • Determines whether or not the service should try to resume prior subscriptions, if it has any

    Parameters

    • clean_session: boolean

      true if the session should drop prior subscriptions when this client connects, false to resume the session

    Returns AwsIotMqttConnectionConfigBuilder

    this builder object

  • Configures Static AWS credentials for this connection. Please note that the static credential will fail when the web session expired.

    Parameters

    • aws_region: string

      The service region to connect to

    • aws_access_id: string

      IAM Access ID

    • aws_secret_key: string

      IAM Secret Key

    • Optional aws_sts_token: string

      session credentials token (optional)

    Returns AwsIotMqttConnectionConfigBuilder

    this builder object

  • Sets the custom authorizer settings. This function will modify the username, port, and TLS options.

    Parameters

    • username: string

      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.

    • authorizer_name: string

      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.

    • authorizer_signature: string

      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.

    • password: string

      The password to use with the custom authorizer. If null is passed, then no password will be set.

    • Optional token_key_name: string

      Key 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: string

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

    Returns AwsIotMqttConnectionConfigBuilder

  • Configures MQTT keep-alive via PING messages. Note that this is not TCP keepalive.

    Parameters

    • keep_alive: number

      How often in seconds to send an MQTT PING message to the service to keep the connection alive

    Returns AwsIotMqttConnectionConfigBuilder

    this builder object

  • Allows additional headers to be sent when establishing a websocket connection. Useful for custom authentication.

    Parameters

    • headers: {
          [index: string]: string;
      }

      Additional headers to send during websocket connect

      • [index: string]: string

    Returns AwsIotMqttConnectionConfigBuilder

    this builder object

Generated using TypeDoc