aws-sdk-js-v3-usage

Implements AWS SDK for JavaScript v3 patterns for clients, credentials, streams, and error handling.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/dennisvink/yolomancer --skill aws-sdk-js-v3-usage-dennisvink
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-sdk-js-v3-usage
Source: https://github.com/dennisvink/yolomancer/tree/main/skills/aws/core-skills/aws-sdk-js-v3-usage
Command: npx skills add https://github.com/dennisvink/yolomancer --skill aws-sdk-js-v3-usage-dennisvink

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct JavaScript or TypeScript code against AWS services with the v3 SDK involves many non-obvious pitfalls: unread streams causing socket exhaustion, mutating resolved client config, wrong credential providers, and streaming deadlocks under parallel load. This Skill provides verified patterns and reference material so generated code follows the SDK's intended usage. ## Core Features & Use Cases - Client and Credential Patterns: Covers bare-bones vs aggregated clients, per-client configuration, all credential providers from @aws-sdk/credential-providers (AssumeRole, SSO, web identity, Cognito), and sharing credentials across regions. - Service-Specific Guidance: Includes DynamoDB DocumentClient marshalling, S3 presigned URLs, multipart uploads, waiters, paginators, middleware, abort controllers, and SigV4a for Multi-Region Access Points. - Operational Best Practices: Documents Lambda initialization patterns, Node.js version requirements, TypeScript typing helpers, error handling with $metadata, and performance tuning for parallel workloads. - Use Case: When asked to write a Lambda function that uploads files to S3 and records metadata in DynamoDB, this Skill ensures the code initializes clients outside the handler, uses lib-storage for multipart upload, and uses lib-dynamodb for native JS types. ## Quick Start Write a Node.js script using the AWS SDK v3 that downloads an object from S3 and handles errors correctly.

Frequently Asked Questions about aws-sdk-js-v3-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use the AWS SDK for JavaScript v3 to call S3?

Import S3Client and command classes from @aws-sdk/client-s3, create a client with an explicit region, and call client.send with a command like GetObjectCommand. The bare-bones client style produces smaller bundles than the aggregated S3 client.

How do I assume an IAM role with aws-sdk-js-v3?

Use fromTemporaryCredentials from @aws-sdk/credential-providers with the RoleArn in params, and pass it as the credentials option when constructing your client. Chained role assumption is supported via the masterCredentials option.

Why does my S3 GetObject request cause socket exhaustion in Node.js?

Unread response streams hold sockets open, leading to exhaustion. Always consume the Body with transformToString or transformToByteArray, pipe it somewhere, or explicitly destroy or cancel it.

Does aws-sdk-js-v3 work in AWS Lambda, and how should clients be initialized?

Yes, but initialize SDK clients outside the handler so they are reused across invocations. One-time async setup should use a lazy flag inside the handler, since network requests made during pre-warming may be frozen.

What Node.js version does aws-sdk-js-v3 require?

SDK version 3.723.0 and later requires Node.js 18 or higher, and version 3.968.0 and later requires Node.js 20 or higher. Check your SDK version against these minimums before deployment.

How do I fix TypeScript errors about mismatched @smithy/types versions?

These errors come from mismatched @smithy/types or @aws-sdk/types versions across client packages. Fix them by pinning all @aws-sdk/client-* packages to the same version range in package.json.