Skip to content
Discussion options

You must be logged in to vote

Hi @tahamansoor ,

The main differences between the two import methods is syntax and structure. Both achieve similar outcomes, but they cater to different coding styles.

When you use:

import { DynamoDBClient } from '@aws-sdk/client-dynamodb';

You're taking advantage of JS SDK v3's modular approach. Here, you directly import the client and then utilize it to send commands. For instance:

import { DynamoDBClient, PutItemCommand} from '@aws-sdk/client-dynamodb'; // adding here each command you want to use.

const client = new DynamoDBClient(/* config */);
client.send(new PutItemCommand(/* command parameters */));

On the other hand, the following import:

import { DynamoDB } from '@aws-sdk/clien…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tahamansoor
Comment options

@rdsedmundo
Comment options

Answer selected by RanVaknin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants