@aws-sdk/client-s3
AWS SDK for JavaScript v3 S3 client with modular commands, streaming, and presigned URL support.
Official Documentation ↗v3. Check the official docs for the latest API surface.Installation
npm install @aws-sdk/client-s3Methods
No methods match this filter.
The v3 S3 client sends explicit command objects and supports tree-shaking through modular packages.
Key Features
- Command-per-operation modular design
- Streaming uploads and downloads
- Presigned URL generation
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
Errors
The official API reference declares the following error types:
InvalidRequest(PutObject 文档声明的错误名(HTTP 响应错误,非 SDK 异常类)) — official text: “You might receive anInvalidRequesterror for several reasons: Depending on the reason for the error, you might receive one of the following messages:” (source: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/PutObjectCommand, fetched 2026-11-08T19:20:00+08:00)
API reference evidence
Fetched from official sources on 2026-11-08T19:20:00+08:00 via WebFetch https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/(该落地页为 JS 渲染,仅返回导航壳);WebFetch https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Class/S3Client;WebFetch https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/PutObjectCommand;WebFetch https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/GetObjectCommand.
new S3Client→ signature from https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-s3/Class/S3Client; official text: “|(constructor)Required|constructor(...[configuration]: CheckOptionalClientConfig<S3ClientConfig>)| Constructs a new instance of theS3Clientclass |”PutObjectCommand→ signature from https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/PutObjectCommand; official text: “const input = { // PutObjectRequest Bucket: “STRING_VALUE”, // required … }; const command = new PutObjectCommand(input); const response = await client.send(command);”GetObjectCommand→ signature from https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/command/GetObjectCommand; official text: “const command = new GetObjectCommand(input); const response = await client.send(command); // consume or destroy the stream to free the socket. const bytes = await response.Body.transformToByteArray();”
FAQ
- Why is my bundle so large?
- Import only the command classes you need; the v3 SDK is designed for tree-shaking, but importing the whole service defeats it.
- How do credentials resolve?
- The default provider chain checks environment variables, shared config files, and IAM roles, so running on EC2 or Lambda needs no explicit keys.
- How do I generate a presigned URL?
- Use getSignedUrl from @aws-sdk/s3-request-presigner with a command and an expiresIn value.
Report a problem with this API docOpens a pre-filled issue on GitHub.