# Getting Started

#### Getting Started with AVS-SDK

Welcome to the Getting Started guide for AVS-SDK! This guide will help you set up the SDK on your machine and provide tips for different installation methods. Whether you're working on Linux, macOS, or Windows, AVS-SDK is easy to install via `npm`, `yarn`, `pnpm`, or `bun`. Alternatively, you can also clone the AVS-SDK repository directly from GitHub.

**Prerequisites**

To use AVS-SDK, ensure you have:

* **Node.js** (v14.0 or later recommended) installed on your system.
* **Git** installed if you’re opting for a clone installation.

To verify if Node.js is installed:

```bash
node -v
```

If Node.js is not installed, download and install it from [Node.js official website](https://nodejs.org/).

#### Step 1: Install AVS-SDK

**Method 1: Using `npm`**

For most users, installing with `npm` is straightforward:

```bash
npm install avs-sdk
```

**Method 2: Using `yarn`**

If you prefer using `yarn`:

```bash
yarn add avs-sdk
```

**Method 3: Using `pnpm`**

For `pnpm` users:

```bash
pnpm add avs-sdk
```

**Method 4: Using `bun`**

To install with `bun`, make sure bun is installed and run:

```bash
bun add avs-sdk
```

**Method 5: Git Clone**

You can also directly clone the AVS-SDK repository from GitHub. This method is useful if you’d like the latest version or if you wish to explore and modify the code.

```bash
git clone https://github.com/Programmer-Shivansh/AVS-SDK
cd AVS-SDK
npm install
```

#### Step 2: Set Up for Different Operating Systems

**Linux Installation Guide**

1. **Install Node.js** (if not already installed):
   * You can use a package manager like `apt` or `dnf` based on your Linux distribution. For example, on Debian/Ubuntu:

     ```bash
     sudo apt update
     sudo apt install nodejs npm
     ```
   * Alternatively, install Node.js via [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm).
2. **Install AVS-SDK**:
   * Use one of the methods described above (e.g., `npm install avs-sdk`).
3. **Clone Setup**:
   * If you prefer cloning from Git, run:

     ```bash
     git clone https://github.com/Programmer-Shivansh/AVS-SDK
     cd AVS-SDK
     npm install
     ```

**macOS Installation Guide**

1. **Install Node.js**:
   * The easiest way on macOS is via `brew`:

     ```bash
     brew install node
     ```
2. **Install AVS-SDK**:
   * Choose an installation method as shown above (e.g., `yarn add avs-sdk`).
3. **Clone Setup**:
   * If cloning, execute:

     ```bash
     git clone https://github.com/Programmer-Shivansh/AVS-SDK
     cd AVS-SDK
     npm install
     ```

**Windows Installation Guide**

1. **Install Node.js**:
   * Download the Windows installer from [Node.js website](https://nodejs.org/) and follow the setup instructions.
2. **Install AVS-SDK**:
   * Open a terminal like PowerShell or the Command Prompt and install AVS-SDK (e.g., `npm install avs-sdk`).
3. **Clone Setup**:
   * To clone the SDK from GitHub, open a Git-enabled terminal and run:

     ```bash
     git clone https://github.com/Programmer-Shivansh/AVS-SDK
     cd AVS-SDK
     npm install
     ```

#### Troubleshooting Installation Errors

Here are some common installation issues you might encounter and tips to resolve them:

**1. Node Version Errors**

If you encounter compatibility issues with the Node version, make sure to use v14.0 or higher. Using NVM (Node Version Manager) can be very helpful to switch Node versions quickly.

**2. Permission Errors on Linux/macOS**

Sometimes, Linux or macOS may require root privileges to install global packages. If you receive a permission error, try prefixing your command with `sudo`, like this:

```bash
sudo npm install -g avs-sdk
```

**3. `npm` or `yarn` Not Found**

Ensure that your package manager is installed and available in your system’s PATH. If it’s missing, re-install Node.js, which usually includes `npm`, or install `yarn` separately by following instructions on the [Yarn website](https://yarnpkg.com/).

**4. Installation Failure on Windows**

If installation fails, try running your terminal as Administrator. Right-click on your terminal and select “Run as Administrator,” then retry the installation command.

**5. Git-Related Issues**

If you’re cloning and encounter a “command not found” error for `git`, install Git from [Git's official website](https://git-scm.com/) and ensure it’s accessible from the terminal.

**Verifying Your Installation**

After installing, you can confirm the SDK is correctly installed by running:

```bash
node -e "require('avs-sdk'); console.log('AVS-SDK is installed successfully!')"
```

#### Next Steps

Now that AVS-SDK is installed, you’re ready to explore its core features. In the next sections, we’ll guide you through setting up your first connection with the AVS Node Manager and using essential modules like `AVSNode`, `AVSSmartContract`, and more to start building decentralized services effortlessly.


---

# 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://shivanshs-organization-2.gitbook.io/avs-sdk/getting-started.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.
