Dark Mode

Connect your app to DataStax Astra DB using the Document API in node.js.

The Astra DB Collection Node.js Client connects to the Astra DB Document API.

  • Install the Astra DB JS Collection:
  • 1
  • Open a browser, navigate to DataStax Astra, and log in.
  • From your Dashboard page, select your database.
  • Copy the *Cluster ID* of your database.

You can also find the *Cluster ID* in the URL, which is the last UUID in the path: https://astra.datastax.com/org/undefined/database/undefined

  • Add the *Cluster ID* as an environment variable with the following command:
  • 1

Example:

  • 1
  • Copy the Region of your database, the region where your database is located.
  • Add the Region as an environment variable with the following command:
  • 1

Example:

  • 1
  • Add your username and your password as environment variables with the following command:
  • 1
  • Use printenv to ensure the environment variables were exported.