mqtt-react-hooks
mqtt-react-hooks copied to clipboard
How can we use authentication?
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
You can use on Connector props: options={{ username: "username", password: "password" }}