TheAWS SDK for JavaScript V3 API Reference Guide describes in detail all the API operations for the AWS SDK for JavaScript version 3 (V3).
Making requests to AWS service clients is straightforward. Version 3 (V3) of the SDK for JavaScript enables you to send requests.
You can also perform operations using version 2 (V2) commands when using the V3 of the SDK for JavaScript. For more information, seeUsing v2 commands.
Initialize a client object with the desired configuration, such as a specific AWS Region.
(Optional) Create a request JSON object with the values for the request, such as the name of a specific Amazon S3 bucket. You can examine the parameters for the request by looking at the API Reference topic for the interface with the name associated with the client method. For example, if you use theAbcCommand
client method, the request interface isAbcInput
.
Initialize a service command, optionally, with the request object as input.
Callsend
on the client with the command object as input.
For example, to list your Amazon DynamoDB tables inus-west-2
, you can do it with async/await.
import{ DynamoDBClient, ListTablesCommand} from "@aws-sdk/client-dynamodb";(async function (){ const dbClient = new DynamoDBClient({ region: 'us-west-2' }); const command = new ListTablesCommand({}); try{ const results = await dbClient.send(command); console.log(results.TableNames.join('\n')); } catch (err){ console.error(err); }})();