> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Alpha Vault TS SDK Getting Started

> Learn how to install @meteora-ag/alpha-vault, initialize an AlphaVault client, read vault state, and test the SDK.

This guide shows how to install and initialize the official Alpha Vault TypeScript SDK, `@meteora-ag/alpha-vault`.

Before you begin, here are the main resources:

<CardGroup cols={2}>
  <Card title="TypeScript SDK" icon="node-js" iconType="solid" href="https://github.com/MeteoraAg/alpha-vault-sdk/tree/main/ts-client">
    SDK source, IDL, transaction helpers, PDA helpers, Merkle tree helpers, and package metadata.
  </Card>

  <Card title="NPM Package" icon="npm" iconType="solid" href="https://www.npmjs.com/package/@meteora-ag/alpha-vault">
    Published package for Alpha Vault TypeScript integrations.
  </Card>
</CardGroup>

## Installation

Install the SDK and Solana dependencies:

<Tabs>
  <Tab title="npm">
    ```bash theme={"system"}
    npm install @meteora-ag/alpha-vault @solana/web3.js @solana/spl-token @coral-xyz/anchor bn.js
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={"system"}
    pnpm install @meteora-ag/alpha-vault @solana/web3.js @solana/spl-token @coral-xyz/anchor bn.js
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={"system"}
    yarn add @meteora-ag/alpha-vault @solana/web3.js @solana/spl-token @coral-xyz/anchor bn.js
    ```
  </Tab>

  <Tab title="bun">
    ```bash theme={"system"}
    bun add @meteora-ag/alpha-vault @solana/web3.js @solana/spl-token @coral-xyz/anchor bn.js
    ```
  </Tab>
</Tabs>

## Initialization

Load an existing Alpha Vault from its vault address:

```typescript theme={"system"}
import AlphaVault, { VaultState } from "@meteora-ag/alpha-vault";
import { Connection, PublicKey } from "@solana/web3.js";

const connection = new Connection(process.env.RPC_URL!, "confirmed");
const vaultAddress = new PublicKey("ALPHA_VAULT_ADDRESS");

const alphaVault = await AlphaVault.create(connection, vaultAddress, {
  cluster: "mainnet-beta",
});

console.log(alphaVault.vaultState === VaultState.DEPOSITING);
console.log(alphaVault.vaultPoint);
```

The package default export is the `AlphaVault` client class. Named exports include enums, types, PDA helpers, Merkle tree helpers, fill helpers, constants, and the IDL.

## Program ID

The SDK maps clusters to these Alpha Vault program IDs:

| Cluster        | Program ID                                    |
| -------------- | --------------------------------------------- |
| `mainnet-beta` | `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` |
| `devnet`       | `vaU6kP7iNEGkbmPkLmZfGwiGxd4Mob24QQCie5R9kd2` |
| `localhost`    | `SNPmGgnywBvvrAKMLundzG6StojyHTHDLu7T4sdhP4k` |

## First Reads

Use these methods and getters before building transactions:

| API                                                 | Use                                                                                   |
| --------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `AlphaVault.create(connection, vaultAddress, opt?)` | Fetches vault, clock, mints, and connected pool timing into an `AlphaVault` instance. |
| `alphaVault.vault`                                  | Decoded on-chain `Vault` account.                                                     |
| `alphaVault.mode`                                   | SDK `VaultMode` value derived from `vault.vaultMode`.                                 |
| `alphaVault.vaultPoint`                             | First join, last join, last buying, start vesting, and end vesting points.            |
| `alphaVault.vaultState`                             | Current lifecycle state from the clock and vault timing.                              |
| `alphaVault.getEscrow(owner)`                       | Fetches the owner escrow PDA or returns `null`.                                       |
| `alphaVault.interactionState(escrow, merkleProof?)` | Computes UI-ready deposit, claim, withdrawal, and whitelist booleans.                 |

## Reference

<CardGroup cols={2}>
  <Card title="SDK Examples" icon="bolt" iconType="solid" href="/developer-guides/alpha-vault/typescript-sdk/examples">
    Explore transaction flows for deposits, claims, fills, Merkle proofs, and authority-created escrows.
  </Card>

  <Card title="SDK Reference" icon="code" iconType="solid" href="/developer-guides/alpha-vault/typescript-sdk/reference">
    Access the SDK method map, PDA helpers, constants, enums, and exported types.
  </Card>
</CardGroup>

## Testing The SDK

The local SDK package uses `tsup` for builds and Jest for tests.

```bash theme={"system"}
cd alpha-vault-sdk/ts-client
npm install
npm run build
npm test
```

Some tests require local validator fixtures and launch-pool artifacts. For application integrations, simulate transactions and test the exact vault and pool configuration before mainnet use.

## Faucets

<CardGroup cols={1}>
  <Card title="Devnet Faucet" icon="faucet" href="https://faucet.solana.com/">
    Request test SOL for devnet integration testing.
  </Card>
</CardGroup>
