Skip to main content
The DynamoDBResourceClient provides a simplified interface for performing operations on your DynamoDB tables.

Usage

import { myDynamoClient } from "./clients";

const result = await myDynamoClient.invoke(
  "GetItem",
  {
    TableName: "users",
    Key: { id: { S: "123" } },
  },
  "get-user"
);

if (result.ok) {
  console.log(result.result.data);
}

Inputs

The invoke method accepts the following arguments:
command
string
required
The DynamoDB command to execute. Supported commands include "GetItem", "PutItem", "UpdateItem", "DeleteItem", "Query", "Scan", etc.
params
Record<string, unknown>
required
The parameters for the command, matching the AWS SDK input shape (e.g., TableName, Key, Item).
invocationKey
string
required
A unique identifier for this operation.
timeoutMs
number
Optional timeout in milliseconds.

Outputs

On success (ok: true), the result object contains:
kind
"database"
Discriminator for the response type.
command
string
The command that was executed.
data
unknown
The result data from DynamoDB (e.g., the Item from a GetItem call).