> For the complete documentation index, see [llms.txt](https://kr-docs.aftermath.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kr-docs.aftermath.finance/developers/getting-started.md).

# Getting Started

## **Install**

```typescript
npm i aftermath-ts-sdk
```

## **Usage**

Create an instance of Aftermath for ease of use to make calls to our server, or create an instance of Aftermath API for finer control of transaction construction.

## Aftermath SDK

### 1. Create Aftermath provider

```javascript
const afSdk = new Aftermath("MAINNET"); // "MAINNET" | "TESTNET" | "DEVNET"
await afSdk.init(); // initialize provider
```

### 2. Create protocol provider

```typescript
const router = afSdk.Router(); 
const pools = afSdk.Pools(); 
const staking = afSdk.Staking(); 
const farms = afSdk.Farms();
```

## Aftermath API

### 1. Create Aftermath API provider

```typescript
const fullnodeEndpoint = "https://fullnode.mainnet.sui.io";
const addresses = {...};

const afApi = new AftermathApi(
    new SuiClient({
        transport: new SuiHTTPTransport({
            url: fullnodeEndpoint,
        }),
    }),
    addresses,
    new IndexerCaller("MAINNET"), // "MAINNET" | "TESTNET" | "DEVNET"
);
```

### 2. Create new protocol provider

```typescript
const poolsApi = afApi.Pools(); 
const stakinApi = afApi.Staking(); 
const farmsApi = afApi.Farms();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://kr-docs.aftermath.finance/developers/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.
