# AWS Sdk Js V3 Usage

AWS SDK for JavaScript v3 development patterns.

- Repository: https://github.com/aws/agent-toolkit-for-aws (3366 stars)
- Category: DevOps
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add aws/agent-toolkit-for-aws --skill aws-sdk-js-v3-usage -g -a claude-code -y`
Codex: `npx skills add aws/agent-toolkit-for-aws --skill aws-sdk-js-v3-usage -g -a codex -y`
Cursor: `npx skills add aws/agent-toolkit-for-aws --skill aws-sdk-js-v3-usage -g -a cursor -y`
Gemini CLI: `npx skills add aws/agent-toolkit-for-aws --skill aws-sdk-js-v3-usage -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add aws/agent-toolkit-for-aws`

## Description

AWS SDK for JavaScript v3 development patterns. Use when writing JavaScript or TypeScript code that uses AWS services via @aws-sdk/* packages (aws-sdk-js-v3), or when asked about schemas, runtime validation, serialization, or code generation in the context of the JS/TS AWS SDK.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

> Do not use emojis in any code, comments, or output when this skill is active.

# AWS SDK for JavaScript v3

## Package Structure

- `@aws-sdk/client-*`, one per service, generated by [smithy-typescript](https://github.com/awslabs/smithy-typescript); one-to-one with AWS services and operations
- `@aws-sdk/lib-*`, higher-level helpers (e.g. `lib-dynamodb`, `lib-storage`)
- `@aws-sdk/*` (no prefix), utility packages (mostly internal; don't import deep paths)

Always import from the package root:

```js
import { S3Client } from "@aws-sdk/client-s3"; // correct
// NOT: import { S3Client } from "@aws-sdk/client-s3/dist-cjs/S3Client"
```

## Two Client Styles

**Bare-bones** (preferred, smaller bundle):

```js
import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3";
const client = new S3Client({ region: "us-east-1" });
const output = await client.send(new GetObjectCommand({ Bucket: "b", Key: "k" }));
```

**Aggregated** (v2-style but NOT v2, larger bundle):

```js
import { S3 } from "@aws-sdk/client-s3";
const client = new S3({ region: "us-east-1" });
const output = await client.getObject({ Bucket: "b", Key: "k" });
```

## Client Configuration

No global config in v3, pass config to each client. `region` is always required; set it explicitly or via `AWS_REGION` env var.

```js
const config = { region: "us-east-1", maxAttempts: 5 };
const s3 = new S3Client(config);
const dynamo = new DynamoDBClient(config);
```

**Do not read or mutate `client.config` after instantiation**, it is a resolved form (e.g. `region` becomes an async function). See `references/effective-practices.md`.

For HTTP handler (`NodeHttpHandler` from `@smithy/node-http-handler`), retry strategy, endpoint details, logging, FIPS, dual-stack, protocol selection, and S3-specific options → see `references/clients.md`.

## Credentials

All providers from `@aws-sdk/credential-providers`. Credentials are lazy and cached per client until ~5 min before expiry.

The rest: https://github.com/aws/agent-toolkit-for-aws/blob/HEAD/plugins/aws-core/skills/aws-sdk-js-v3-usage/SKILL.md
