Back to Aws Sdk Js V3

Package Consolidation - @aws-sdk Non-Client Package Usage

packages-internal/core/planning/consolidation.md

3.1046.013.3 KB
Original Source

Package Consolidation - @aws-sdk Non-Client Package Usage

Similar to what was done in https://github.com/smithy-lang/smithy-typescript/blob/main/packages/core/planning/consolidation.md, we are planning to consolidate down the overall number of unique NPM packages needed to run the AWS SDK core.

As an initial assessment, the following tables show what packages (non-clients) share the same subset of client dependents. This creates a natural grouping guide.

This analysis was performed on the package graph as of 2026-05-11 v3.1045.0.

Group A (Core) — All 425 clients

These can be moved into core, except types, which will remain standalone.

PackageDescription
@aws-sdk/coreCore functions & classes shared by multiple AWS SDK clients
@aws-sdk/typesShared TypeScript types for the AWS SDK
@aws-sdk/middleware-host-headerMiddleware that sets the Host header on requests
@aws-sdk/middleware-loggerMiddleware that logs successful/failed API calls
@aws-sdk/middleware-recursion-detectionMiddleware that detects and marks recursive Lambda invocations
@aws-sdk/middleware-user-agentMiddleware that appends SDK user-agent string to requests
@aws-sdk/util-user-agent-nodeConstructs the user-agent string in Node.js environments
@aws-sdk/util-user-agent-browserConstructs the user-agent string in browser environments
@aws-sdk/region-config-resolverResolves region configuration from environment/config files
@aws-sdk/util-endpointsUtilities for endpoint resolution (rules engine)
@aws-sdk/xml-builderXML serialization utilities for AWS request/response bodies

Group B (Nested-Clients) — 424 clients (all except client-sts and client-sso-oidc)

Unexpectedly, middleware-sdk-s3 is pulled into nested-clients due to STS' recently taking a dependency on signature v4a, which brings sigv4-multi-region and then middleware-sdk-s3.

We should refactor the code so that middleware-sdk-s3 is only used by the S3 service's client group.

Move util-arn-parser into core.

PackageDescription
@aws-sdk/nested-clientsLightweight STS/SSO clients used internally by credential providers
@aws-sdk/middleware-sdk-s3S3-specific middleware (pulled transitively via nested-clients)
@aws-sdk/signature-v4-multi-regionSigV4a signing for multi-region access points
@aws-sdk/token-providersToken providers for bearer-token auth (SSO)
@aws-sdk/util-arn-parserParses Amazon Resource Names into components

Group C (Credential Providers) — 423 clients (all except client-sts, client-sso-oidc, client-sso)

We should move all credential providers and token-providers into a single internal package. Keep in mind however, it should not be @aws-sdk/credential-providers because this is the external-facing package.

PackageDescription
@aws-sdk/credential-provider-nodeDefault credential chain for Node.js (aggregates all providers)
@aws-sdk/credential-provider-iniReads credentials from ~/.aws/credentials and ~/.aws/config
@aws-sdk/credential-provider-envReads credentials from environment variables
@aws-sdk/credential-provider-httpFetches credentials from HTTP endpoints (ECS/container)
@aws-sdk/credential-provider-loginReads credentials from aws login cached tokens
@aws-sdk/credential-provider-processRuns credential_process commands from AWS config
@aws-sdk/credential-provider-ssoExchanges SSO login tokens for temporary credentials
@aws-sdk/credential-provider-web-identityCalls STS AssumeRoleWithWebIdentity for credentials
@aws-sdk/credential-provider-cognito-identityBrowser credential provider via Cognito

Group D (Event Streams) — 8 clients (bedrock-runtime, connecthealth, lex-runtime-v2, polly, qbusiness, rekognitionstreaming, sagemaker-runtime-http2, transcribe-streaming)

Consolidate into @aws-sdk/middleware-eventstream?

PackageDescription
@aws-sdk/eventstream-handler-nodeNode.js handler for event-stream (bidirectional streaming)
@aws-sdk/middleware-eventstreamMiddleware for event-stream protocol support

Group E — 7 clients (bedrock-runtime, docdb, ec2, neptune, rds, rekognitionstreaming, transcribe-streaming)

Move util-format-url into core.

PackageDescription
@aws-sdk/util-format-urlFormats presigned URL objects into URL strings

Group F (Endpoint Discovery) — 3 clients (dynamodb, timestream-query, timestream-write)

Consolidate into @aws-sdk/middleware-endpoint-discovery.

PackageDescription
@aws-sdk/endpoint-cacheLRU cache for discovered endpoints
@aws-sdk/middleware-endpoint-discoveryMiddleware for endpoint discovery (DynamoDB, Timestream)

Group G (RDS) — 3 clients (docdb, neptune, rds)

Leave as-is.

PackageDescription
@aws-sdk/middleware-sdk-rdsRDS-specific middleware (presigned auth tokens)

Group H (Event Streams for Browser) — 3 clients (bedrock-runtime, rekognitionstreaming, transcribe-streaming)

Leave as-is.

PackageDescription
@aws-sdk/middleware-websocketWebSocket transport middleware (Transcribe streaming)

Group I (CRT)

Leave as-is.

PackageDescription
@aws-sdk/crt-loaderLoads the AWS Common Runtime native bindings
@aws-sdk/crc64-nvme-crtNative CRC64 (optional perf optimization)
@aws-sdk/signature-v4-crtSigV4/SigV4a signing via AWS Common Runtime (native)

Group S3

Consolidate into S3 group (middleware-sdk-s3). After removing middleware-sdk-s3 from group B. Consolidate into S3 group (middleware-sdk-s3). However, move checksums related code into @aws-sdk/checksums (new package).

PackageDescription
@aws-sdk/middleware-bucket-endpointResolves S3 bucket-style endpoints (path vs virtual-hosted)
@aws-sdk/middleware-sdk-s3-controls3-control
@aws-sdk/middleware-expect-continueAdds Expect: 100-continue header for large S3 uploads
@aws-sdk/middleware-location-constraintSets S3 LocationConstraint on CreateBucket
@aws-sdk/middleware-ssecHandles S3 server-side encryption with customer keys

Group Checksums

PackageDescription
@aws-sdk/crc64-nvmePure JS implementation of CRC64-NVME checksum
@aws-sdk/middleware-flexible-checksumsComputes/validates request/response checksums (CRC32, SHA256, etc.)

Group K (Glacier) — 1 client (glacier)

Consolidate into middleware-sdk-glacier.

PackageDescription
@aws-sdk/body-checksum-browserComputes request body checksums in browser
@aws-sdk/body-checksum-nodeComputes request body checksums in Node.js
@aws-sdk/chunked-stream-reader-nodeReads Node.js streams in fixed-size chunks
@aws-sdk/middleware-sdk-glacierGlacier-specific middleware (tree-hash checksums)
@aws-sdk/sha256-tree-hashComputes SHA-256 tree hash (Glacier)

Singletons — 1 client each, unique client set

Leave as-is, but move @aws-sdk/middleware-sdk-s3-control into S3 group.

PackageClientDescription
@aws-sdk/dynamodb-codecdynamodbEncodes/decodes DynamoDB AttributeValue format
@aws-sdk/middleware-sdk-api-gatewayapi-gatewayAPI Gateway-specific middleware (accepts header)
@aws-sdk/middleware-sdk-ec2ec2EC2-specific middleware (copy-encrypted-snapshot presigning)
@aws-sdk/middleware-sdk-machinelearningmachine-learningMachineLearning-specific middleware (predict endpoint)
@aws-sdk/middleware-sdk-route53route-53Route53-specific middleware (trims hosted zone ID prefix)
@aws-sdk/middleware-sdk-sqssqsSQS-specific middleware (MD5 checksum validation)
@aws-sdk/middleware-sdk-transcribe-streamingtranscribe-streamingTranscribe Streaming-specific middleware

Packages unused by any client

These @aws-sdk/* packages are not in any client's transitive dependency closure.

User-facing utilities (imported directly by users, not client deps)

PackageDescription
@aws-sdk/credential-providersAggregated credential provider
@aws-sdk/lib-dynamodbDynamoDB document client
@aws-sdk/lib-storageS3 multipart upload helper
@aws-sdk/s3-request-presignerS3 presigned URLs
@aws-sdk/s3-presigned-postS3 presigned POST
@aws-sdk/rds-signerRDS IAM auth tokens
@aws-sdk/dsql-signerDSQL auth tokens
@aws-sdk/polly-request-presignerPolly presigned URLs
@aws-sdk/cloudfront-signerCloudFront signed URLs/cookies
@aws-sdk/util-dynamodbDynamoDB marshalling utilities
@aws-sdk/xhr-http-handlerXMLHttpRequest-based HTTP handler
@aws-sdk/ec2-metadata-serviceEC2 instance metadata client
@aws-sdk/configShared config utilities
@aws-sdk/signature-v4aJS SigV4a implementation (opt-in)

Legacy

PackageDescription
@aws-sdk/middleware-signingDeprecated, replaced by @smithy/core signing
@aws-sdk/middleware-tokenBearer token middleware
@aws-sdk/middleware-api-keyAPI key auth middleware
@aws-sdk/protocol-httpRe-export of @smithy/protocol-http
@aws-sdk/smithy-clientRe-export of @smithy/smithy-client
@aws-sdk/util-create-requestDeprecated presign utility
@aws-sdk/middleware-sdk-stsSTS-specific middleware (inlined into nested-clients)

Unreleased

PackageDescription
@aws-sdk/middleware-http-debug-logDebug logging, unreleased
@aws-sdk/util-dnsSRA - never released