The `amazon-qldb-driver-nodejs` package provides an official Node.js driver for interacting with Amazon Quantum Ledger Database (QLDB). It simplifies common tasks like managing sessions, executing transactions, and handling retries for transient errors with QLDB. Currently at stable version 3.1.0, the driver integrates seamlessly with the AWS SDK for JavaScript V3, requiring its V3 client peer dependencies for operation. It facilitates the exchange of data using Amazon ION documents, which is QLDB's underlying immutable data format. Releases occur periodically, with significant updates often aligning with AWS SDK version changes, ensuring compatibility and leveraging the latest AWS features. This package is an official offering from AWS Labs, differentiating it from community-driven alternatives by offering direct support for QLDB's unique ledger-first, immutable data model and providing robust transaction management and error handling.
npm install amazon-qldb-driver-nodejsVerified import paths — ran on the pinned version, not inferred.
Initializes the QLDB driver, retrieves a list of table names, and demonstrates a basic transaction to insert a document, followed by a query to retrieve it.
Follow the AWS SDK for JavaScript V3 migration guide and ensure all peer dependencies like `@aws-sdk/client-qldb-session` are updated to compatible V3 major versions (e.g., `^3.x.x`).
Review application code against the official QLDB Node.js driver documentation to ensure compliance with supported API usage and retry configurations, especially around session and transaction lifecycle.
Upgrade the driver to version 2.2.0 or newer to resolve these transaction-related stability issues. Version 2.2.0 introduced significant improvements to retry logic and session handling that mitigate these errors.
Ensure all required peer dependencies, especially the `@aws-sdk` client packages and `ion-js`, are explicitly installed in your project's `package.json` with compatible versions. For driver v3.x.x, `@aws-sdk` packages must also be v3.x.x.
Set `AWS_SDK_LOAD_CONFIG=1` in your application's environment, or explicitly configure AWS credentials and region within the `QLDBSessionClientConfig` object when initializing the driver.
Upgrade the `amazon-qldb-driver-nodejs` package to version `3.0.1` or newer, which includes a bug fix for this session management issue.
Upgrade the `amazon-qldb-driver-nodejs` package to `v2.2.0` or newer to resolve known transaction handling bugs.
Install or update `@aws-sdk/client-qldb` and `@aws-sdk/client-qldb-session` to compatible V3 major versions (e.g., `^3.x.x`) that align with the driver's requirements.
Verify that AWS credentials and region are correctly configured through environment variables, `~/.aws/config` (with `AWS_SDK_LOAD_CONFIG=1`), or explicitly in the `QLDBSessionClientConfig`. Check network access to AWS QLDB endpoints and the QLDB service status.