I use AWS IoT for real-time update in my web application. The application connects to AWS IoT using aws-iot-device-sdk:
const client = awsIot.device({
region: awsConfig.region,
protocol: 'wss',
accessKeyId: <accessKey>,
secretKey: <secretKey>,
sessionToken: <sessionToken>,
port: 443,
host: <iotEndpoint>
});
client.on('connect', res => {
// ok
});
I want to use AWS Lifecycle Events. For example:
$aws/events/presence/connected/{clientId}
How to get MQTT client id?