A client library lets application code call a service’s API. AWS provides language-specific software development kits (SDKs) for this purpose. An SDK handles repetitive work such as authentication, HTTPS communication, retries, and XML or JSON conversion, so an application can call service functions instead of assembling HTTP requests itself. section 4.0 section 4.3
Choose an SDK when an application needs to use AWS services—for example, storing an image in S3, writing a DynamoDB item, or sending an SQS message. The Management Console is a web interface, the CLI is suited to terminal commands and scripts, and CloudFormation describes a desired infrastructure state. SDK calls fit inside application code. section 1.7.3 section 4.6 section 7.5
A small Node.js integration follows this pattern:
- Install Node.js, check it with `node --version`, and install the application’s dependencies with `npm install`. section 4.3 section 14.2.4
- Load `aws-sdk`, create a service client, and supply a parameter object—for example, an S3 bucket and object body or an SQS queue URL and message body. section 7.5.3 section 14.2.4
- Call the service function, then handle an error or process the result. The SDK sends the underlying API request. section 12.3.1 section 7.5.3
An image gallery backed by S3
A web application uploads an image with `s3.putObject(...)`, lists stored images with `s3.listObjects(...)`, and renders links that let visitors download them. Its upload example sets images to public read, so anyone with an image’s bucket name and key can download it; use that access setting only when public images are intended. Delete the example bucket when finished. section 7.5 section 7.5.3
Listing 7.1 Uploading an image with the AWS SDK for S3
const AWS = require('aws-sdk'); #1
const uuid = require('uuid');
const s3 = new AWS.S3({ #2
'region': 'us-east-1'
});
const bucket = process.argv[2];
async function uploadImage(image, response) {
try {
await s3.putObject({ #3
Body: image, #4
Bucket: bucket, #5
Key: uuid.v4(), #6
ACL: 'public-read', #7
ContentLength: image.byteCount, #8
ContentType: image.headers['content-type'] #9
}).promise();
response.redirect('/');
} catch (err) { #10
console.error(err);
response.status(500);
response.send('Internal server error.'); #11
}
}
The upload listing shows the S3 client, `putObject` parameters, a promise-based call, and error handling together. section 7.5.3
The same approach extends beyond storage. An EC2 client can list running or pending virtual machines; a DynamoDB client can add an item; and an SQS client can send a message to a queue. The operations and parameter objects change, but the application still calls a service client and handles its response. section 4.3.3 section 12.3 section 14.2.4





