> For the complete documentation index, see [llms.txt](https://docs.yo.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yo.xyz/integrations/integration-guides/sdk/core/overview.md).

# Overview

The framework-agnostic TypeScript SDK for the Yo yield protocol. Use it in any environment — Node.js, serverless functions, scripts, or the browser.

## What's Inside

| Module          | Purpose                                                                        |
| --------------- | ------------------------------------------------------------------------------ |
| **YoClient**    | Main entry point — wraps reads, actions, and API calls in a single interface   |
| **Vault reads** | On-chain state queries: vault state, balances, allowances, conversion previews |
| **Actions**     | Transaction builders: deposit via gateway, request withdrawal, redeem, approve |
| **API client**  | REST client for off-chain data: snapshots, APY/TVL timeseries, user history    |
| **Constants**   | Vault addresses, chain configs, contract ABIs                                  |

## Architecture

```
YoClient (entry point)
├── publicClient (viem) — On-chain reads
├── walletClient (viem) — Transaction signing
└── apiClient (fetch) — REST API calls
```

The client is initialized with a `chainId` and optional viem clients. If no `publicClient` is provided, one is created automatically via `http()` transport.

## Quick Example

```ts
import { createYoClient, VAULTS } from '@yo-protocol/core'

// 1 — Create a client targeting Base
const client = createYoClient({ chainId: 8453 })

// 2 — Read on-chain vault state
const state = await client.getVaultState(VAULTS.yoETH.address)
console.log(state.name, state.totalAssets)

// 3 — Fetch off-chain snapshot (TVL, APY, pools)
const snapshot = await client.getVaultSnapshot(VAULTS.yoETH.address)
console.log(`APY: ${snapshot.apy}%`, `TVL: $${snapshot.tvl}`)
```

{% hint style="info" %}
**No framework required**

`@yo-protocol/core` has zero React or DOM dependencies. It works anywhere that supports `fetch` and `BigInt` — backend services, CLI tools, scripts, or browsers.
{% endhint %}

## Chains

| Chain    | Chain ID | Status    |
| -------- | -------- | --------- |
| Ethereum | `1`      | Supported |
| Base     | `8453`   | Supported |

## Next Steps

* [Client](broken://pages/9d7260e75dd75f06619208e7e14336dbf6509033) — Creating and configuring YoClient
* [Vault Reads](broken://pages/d68e3d414b4e85e74716da059762a410642e5b70) — Querying on-chain vault state
* [Actions](broken://pages/c0d48baa517ce45149c5d9a002ad6e0e80295eb2) — Building deposit, withdraw, and approve transactions
* [API Client](broken://pages/5ca6b1a45df09b8899f1089e56c0b4869ca537e3) — Fetching snapshots, timeseries, and user history
* [Constants](broken://pages/316177dbbaa039279d32a4e39dff04638fd16ee6) — Vault addresses and chain configs
* [Types](broken://pages/058f9022a1a38cb759535b76991f8cc6fb77704b) — Full type reference


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.yo.xyz/integrations/integration-guides/sdk/core/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
