How to get AWS IOT client id?

Home Forum IoT Software Platforms AWS IoT Development Platform How to get AWS IOT client id?

This topic contains 1 reply, has 2 voices, and was last updated by  Jessica 1 year, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #949

    Hamilton
    Participant

    Hello,
    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?

    #969

    Jessica
    Participant

    Hi,
    If you look at the documentation, you will see that clientId is one of the parameters you can supply to the device() method. You should be generating a client ID for each connected device that is unique to your application (i.e. unique to your AWS IoT account).

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.