Dark Mode

Connect your app to DataStax Astra DB or Stargate using a REST interface from node.js.

The Astra DB REST Client connects to the Astra DB REST API and the Astra DB Document API.

Set up your environment

  • Install the Astra DB JS Collection:
  • Open a browser, navigate to Astra DB, 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:
  • Add the *Cluster ID* as an environment variable with the following command:
  • Copy the Region of your database, the region where your database is located.
  • Add the Region as an environment variable with the following command:
  • Add your application token as environment variables with the following command:
  • Use printenv to ensure the environment variables were exported.