# 1. Environment Setup

### Set up your environment

Make sure your development environment includes [Node.js](https://nodejs.org) and an npm package manager.

To check if you have Node.js installed, run this command in your terminal:

```
node -v
```

To confirm that you have npm installed, you can run this command in your terminal:

```
npm -v
```

### Install Create React App

You'll need to have Node v8.16.0 or Node v10.16.0 or a later version on your machine.

```
npx create-react-app my-first-hat-app
```

If you use npm 5.1 or earlier you can't use **npx**. Instead, install **create-react-app** globally:

```
npm install -g create-react-app
create-react-app my-first-hat-app
```

And you can start by typing:

```
cd my-first-hat-app
npm start
```

Then open <http://localhost:3000/> to see your app.

Testing HATs are configured to support requests from <https://localhost:3000> by default. If you run the project locally on a different port, the requests will not come through by the CORS policy.

### Install HAT-JS

Now you can install the HAT-JS:

```
npm install @dataswift/hat-js
```

You'll need to restart the server every time you install a package using npm. You can use **Ctrl + C** to stop the server and **npm start** to start the server.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dataswyft.com/build/getting-started/react-pda/1.-environment-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
