Skip to main content
The @healthzkit/dynamo package provides HealthAdapter helpers for AWS SDK v2 aws-sdk and v3 @aws-sdk/client-dynamodb. Successful checks call ListTables with Limit: 1 and return ok with metadata.latencyMs plus any fields from an optional metadata hook; failures return fail with the caught error. Install the adapter package and one AWS SDK:
Both SDKs are optional peers — install only the one you use.

Package entrypoints

  • @healthzkit/dynamo - dynamoV2Adapter, dynamoV3Adapter, and their option types.
  • @healthzkit/dynamo/v2 - dynamoV2Adapter only.
  • @healthzkit/dynamo/v3 - dynamoV3Adapter only.
Use subpath imports when you want to avoid pulling the unused SDK into your bundle analysis path.

Shared options

Both factories accept BaseDynamoOptions: Pass either config or an existing client (not both). The shape depends on the adapter (see below).

dynamoV2Adapter (aws-sdk)

Peer: aws-sdk >= 2. Uses the v2 DynamoDB client and listTables({ Limit: 1 }). Suitable for legacy services still on AWS SDK for JavaScript v2.

Config

The adapter lazily imports aws-sdk, constructs new AWS.DynamoDB(config) once, and reuses it across checks.

Existing client

dynamoV3Adapter (@aws-sdk/client-dynamodb)

Peer: @aws-sdk/client-dynamodb >= 3. Uses DynamoDBClient and ListTablesCommand with Limit: 1. Prefer this for new code on AWS SDK for JavaScript v3.

Config

The adapter lazily imports @aws-sdk/client-dynamodb, constructs new DynamoDBClient(config) once, and reuses it across checks.

Existing client

Scheduling

For DynamoDB tables that should not be queried on every probe, pair these adapters with a schedule on the check so readiness reads cached results (see Scheduling).