You need valid AWS credentials before making API calls. The SDK reads credentials from environment variables,
~/.aws/credentials, IAM roles, and other sources automatically. See Authentication for the full list of credential providers.Send your first command
Create a file called Run the file:If your credentials are configured and you have DynamoDB tables in
index.js and add the following code. It creates a DynamoDB client for us-west-2, sends a ListTablesCommand, and prints your table names.- CommonJS
- ES modules / TypeScript
index.js
us-west-2, their names print to the console.Try the aggregated style (optional)
V3 also supports a v2-compatible aggregated style where all commands are available as methods directly on the client. This is convenient for quick scripts but imports all commands, which increases bundle size.Both styles call the same underlying API. The difference is only in what gets imported. For production applications and anything built with a bundler, prefer the bare-bones style (
- CommonJS
- ES modules / TypeScript
index.js
DynamoDBClient + ListTablesCommand) so tree shaking can remove unused commands.How it works
Every SDK operation follows the same three-step pattern regardless of the service:- Create a client — instantiate a service-specific client with at minimum a
region. - Create a command — instantiate a command with the input parameters for the operation.
- Send the command — call
client.send(command)and await the response.
Next steps
Installation
Install clients for other services, credential providers, and higher-level libraries.
Authentication
Configure credentials with environment variables, IAM roles, SSO, and more.
Core concepts
Learn about clients, commands, the middleware stack, and paginators.
Migrating from v2
Upgrade an existing v2 application to v3.