OptionalcleanWhether the broker should start a clean session (default true).
OptionalclientClient identifier; a random one is generated when omitted.
Remote broker host (ignored when transport: 'ws'; use connectWebSocket).
OptionalkeepKeep-alive interval in seconds (default 60); 0 disables keep-alive PINGREQs.
OptionalpasswordPassword for credential auth.
OptionalportRemote port; defaults to 1883.
OptionalschedulerOptional timer override for the keep-alive loop (mainly for testing).
OptionaltimeoutRead deadline in milliseconds for the connect handshake.
OptionaltlsTransport security:
'off': plaintext TCP.'implicit': TLS from the first byte (typically port 8883).'starttls': plaintext, upgraded to TLS before CONNECT.Defaults to 'off'.
OptionaltransportTransport to use; 'tcp' (default) or 'ws' for MQTT-over-WebSocket.
OptionalurlWebSocket URL, required when transport: 'ws'.
OptionalusernameUsername for credential auth.
OptionalwillLast Will and Testament: the broker publishes this if the client drops without a clean
DISCONNECT (e.g. close({ graceful: false })), enabling offline detection.
Options for connect.
Since
1.0.0