Sample code to demonstrate setting custom user agent string. These are examples for the AWS SDK for JavaScript version 2 (v2) public documentation.
aws_access_key_id and aws_secret_access_key in ~/.aws/credentials optionally you can have AWS configuration like region, output format etc in ~/.aws.config
Node.js AWS SDK for JavaScript downloaded and extracted somewhere on your machine AWS credentials in a shared credentials file
node userAgentEc2.js node userAgentS3.js