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

# Install the Pesa SDK

> A thin TypeScript client for the transfers API, the chain registry, and the verifiers that check every action before a wallet prompt.

<Note>
  `@pesa/sdk` is in preview. Access is by request until it is published on npm. Write to the team through [pesapay.xyz](https://pesapay.xyz).
</Note>

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install @pesa/sdk viem @stellar/stellar-sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @pesa/sdk viem @stellar/stellar-sdk
  ```

  ```bash yarn theme={null}
  yarn add @pesa/sdk viem @stellar/stellar-sdk
  ```
</CodeGroup>

`viem` (2.x) and `@stellar/stellar-sdk` (16.x) are peer dependencies. The SDK uses them to decode and check EVM calls and Stellar transactions. Install exactly one copy of `@stellar/stellar-sdk` in your bundle: the Stellar verifiers use `instanceof`, which fails across two copies.

The package is ESM only and runs in browsers, React Native and Node.

## What is in it

| Export | What it is |
| - | - |
| `createTransfersClient` | Typed client for every `/v1` endpoint |
| `TransfersApiError` | The error the client throws on a non-2xx reply |
| `CCTP_EVM_CHAINS`, `STELLAR_CCTP`, `findEvmChain` | The chain registry: CAIP-2 IDs, CCTP domains, contract addresses, sponsored and Fast Transfer flags |
| `verifyCctpCalls`, `verifySendToAddress`, `verifyStellarPayment`, ... | Verifiers. See [Verifiers](/sdk/verifiers) |
| `toStellarUnits`, `fromStellarUnits` | 6-decimal to 7-decimal USDC conversion |
| `encodeHookData`, `decodeHookData`, `buildCctpBurnCalls` | CCTP helpers |
| `sep24Status`, `TRANSITIONS`, `TERMINAL`, `CANCELLABLE` | Transfer state tables |
| Types | `QuoteRequest`, `QuoteResponse`, `Action`, `Submission`, `TransferView`, `RouteInfo`, `Stage`, `Sep24Status` |

## Create a client

```ts theme={null}
import { createTransfersClient } from "@pesa/sdk";

const pesa = createTransfersClient({
  baseUrl: "https://api.pesapay.xyz",
  getToken: async () => myToken,   // SEP-10 JWT or Privy access token
  fetch: globalThis.fetch,         // optional
});
```

`getToken` is called before every authenticated request, so it can refresh a token on demand. See [Authentication](/developers/authentication).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.