# Installation setup

## Prerequisites

Before using the API, ensure you have the following installed:

* **Node.js** (version 18 or higher)
* **npm** (for package management)

## Installation

Install required dependencies with these commands:

```bash
npm install dotenv axios @aptos-labs/ts-sdk
```

### Aptos Client & Account Setup

Configure your TypeScript environment with this template:

```typescript
// Import required packages
import dotenv from 'dotenv';
import axios from 'axios';
import { 
  AptosConfig, 
  Aptos, 
  Network, 
  Account, 
  Ed25519PrivateKey, 
  PrivateKeyVariants 
} from "@aptos-labs/ts-sdk";

// Load environment variables
dotenv.config();

// Initialize Aptos client
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);

// Configure account
const formattedPrivateKey = PrivateKey.formatPrivateKey(
  process.env.APTOS_PRIVATEKEY || '',
  'ed25519' as PrivateKeyVariants
);

const account = Account.fromPrivateKey({
  privateKey: new Ed25519PrivateKey(formattedPrivateKey),
});
```


---

# 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.kanalabs.io/perpetual-futures/kana-perps/for-developers-and-mms/installation-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.
