I am using the AWS IoT SDK for JavaScript library in the given link,
https://github.com/aws/aws-iot-device-sdk-js/blob/master/README.md
This is my code,