Installing Only the Clients You Need
In boto3 you pip install boto3 once and every AWS service is available. The AWS SDK for JavaScript v3 works the opposite way: there is no single package that contains all the services.
Busca en todas las páginas de la documentación
In boto3 you pip install boto3 once and every AWS service is available. The AWS SDK for JavaScript v3 works the opposite way: there is no single package that contains all the services.
Instead, each service is published as its own npm package named @aws-sdk/client-<service>. You install only the ones you use. This is the design decision that makes v3 friendly to browsers and Lambda, and it is worth understanding early.
Install one client package per service, then import the client and the commands you need from it.
// Terminal:
// npm install @aws-sdk/client-s3
// npm install @aws-sdk/client-dynamodb
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
import { DynamoDBClient, PutItemCommand } from "@aws-sdk/client-dynamodb";
const s3 = new S3Client({ region: "us-east-1" });
const ddb = new DynamoDBClient({ region: "us-east-1" });When to reach for this:
node_modules and Docker image to carry only the services you actually call.aws-sdk monolith and want the modular equivalent.A realistic app touches a handful of services and a couple of helper libraries. Install each one explicitly.
// Terminal:
// npm install @aws-sdk/client-s3 @aws-sdk/client-sqs @aws-sdk/client-dynamodb
// npm install @aws-sdk/credential-providers @aws-sdk/lib-storage
import { S3Client } from "@aws-sdk/client-s3";
import { SQSClient } from "@aws-sdk/client-sqs";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { fromNodeProviderChain } from "@aws-sdk/credential-providers";
import { Upload } from "@aws-sdk/lib-storage";
const credentials = fromNodeProviderChain();
const region = "us-east-1";
const s3 = new S3Client({ region, credentials });
const sqs = new SQSClient({ region, credentials });
const ddb = new DynamoDBClient({ region, credentials });
// Upload from @aws-sdk/lib-storage handles multipart automatically.
const upload = new Upload({ client: s3, params: { Bucket: "my-bucket", Key: "big.bin", Body: someStream } });
await upload.done();What this demonstrates:
@aws-sdk/client-* packages, one import each.credential-providers, lib-storage) are their own packages, not bundled into the clients.aws-sdk package containing every service, often 40+ MB unpacked. Importing it pulled the whole surface into your bundle.@aws-sdk/client-<service>, so node_modules grows only with the services you install.@aws-sdk/client-s3, @aws-sdk/client-dynamodb, @aws-sdk/client-sqs, and so on - always lowercase and hyphenated.@aws-sdk/credential-providers.@aws-sdk/lib-storage (multipart uploads) and @aws-sdk/s3-request-presigner (presigned URLs).@aws-sdk/lib-dynamodb (the Document client that hides attribute-value typing).package.json sees exactly which AWS services the app talks to.GetObject contains only that command's code.boto3 is deliberately monolithic. pip install boto3 gives you every service through boto3.client("<name>"), selected by string at runtime. Python apps rarely ship to size-constrained runtimes, so there is little pressure to trim. v3 optimizes for the browser and Lambda, where that same monolith would be a liability - which is exactly why the packaging models diverge.
aws-sdk v3 package - there is none; installing one client per service is the intended model. Fix: install @aws-sdk/client-<service> for each service you call.npm install aws-sdk gives you the maintenance-mode v2 monolith, not v3. Fix: install the scoped @aws-sdk/* packages instead.@aws-sdk/client-* versions can pull duplicate copies of shared internals. Fix: keep all @aws-sdk/* packages on the same version and update them together.@aws-sdk/s3-request-presigner or @aws-sdk/lib-storage explicitly.| Alternative | Use When | Don't Use When |
|---|---|---|
Per-service @aws-sdk/client-* (v3) | Any new project; browser or Lambda targets | You are stuck maintaining legacy v2 code |
v2 aws-sdk monolith | Maintaining an existing v2 app only | Starting fresh - it is in maintenance mode |
@aws-sdk/lib-* helpers | You need multipart upload or DynamoDB Document client | A single low-level command already suffices |
No. v3 has no monolith. You install one @aws-sdk/client-<service> package per service you use.
@aws-sdk/client-s3. The convention is always @aws-sdk/client-<service>, lowercase and hyphenated.
To keep bundles and Lambda deployment packages small. You install and ship only the services you call, and bundlers can tree-shake unused operations on top of that.
It works but is in maintenance mode (v2). Do not start new projects on it; use the modular @aws-sdk/* packages for anything new.
Separate helper packages: @aws-sdk/credential-providers for credentials, @aws-sdk/s3-request-presigner for presigned URLs, @aws-sdk/lib-storage for multipart uploads.
No. The @aws-sdk/client-* packages ship their own TypeScript types, so there is no separate @types install.
Yes. Keeping every @aws-sdk/* package on one version avoids duplicate copies of shared internals and subtle incompatibilities.
boto3 is one package for all services, selected by string at runtime. v3 is one package per service, imported by name, so only what you use is installed and shipped.
Only the operations you import end up in a tree-shaken bundle. The install itself is per-service, so it is far smaller than pulling a whole monolith.
Install a client package for each. Your package.json then documents exactly which AWS services the app depends on, which is useful for audits and reviews.
Stack versions: This page was written for the AWS SDK for JavaScript v3 on Node.js 18+ (and boto3 1.43.x / Python 3.10+ where contrasted).
Revisado por Chris St. John·Última actualización: 23 jul 2026