mqtt-react-hooks icon indicating copy to clipboard operation
mqtt-react-hooks copied to clipboard

How can we use authentication?

Open inteldon opened this issue 2 years ago • 1 comments

How can we use authentication with MQTT username and password?

Use the provided example I tried this

export default function MqttConn(){
    const url = "some url:port"   
    return (
        <Connector brokerUrl={url}>
            <Status/>
        </Connector>
    )
}

The status shows as "Connecting" which is expected, but I need to provide username and password to connect. Please help.

Thanks

inteldon avatar Apr 16 '22 18:04 inteldon

You can use on Connector props: options={{ username: "username", password: "password" }}

VictorHAS avatar Apr 19 '22 22:04 VictorHAS