# Overview

**Welcome to the Zama SDK!**

{% hint style="info" %}
**Looking for the legacy Relayer SDK?**

This is the new default SDK for building on the Zama Protocol. The legacy `@zama-fhe/relayer-sdk` lives at [github.com/zama-ai/relayer-sdk](https://github.com/zama-ai/relayer-sdk).
{% endhint %}

## Where to go next

If you're new to the Zama Protocol, start with the [Litepaper](https://docs.zama.ai/protocol/zama-protocol-litepaper) or the [Protocol Overview](https://docs.zama.ai/protocol) to understand the foundations.

Otherwise:

🟨 Go to [**Quick start**](/protocol/sdk/getting-started/quick-start.md) to get from zero to a working confidential transfer in under 5 minutes.

🟨 Go to [**Build your first confidential dApp**](/protocol/sdk/getting-started/first-confidential-dapp.md) for an end-to-end React tutorial.

🟨 Go to [**Guides**](broken://pages/JlRfqGCkAHxsGtopwL1A) for step-by-step instructions on shielding, transfers, balances, and more.

🟨 Go to [**SDK reference**](/protocol/sdk/api-references/sdk.md) for the full core SDK API.

🟨 Go to [**React reference**](/protocol/sdk/api-references/react.md) for all React hooks and components.

## Features

### Shield & unshield

Convert public ERC-20 tokens into encrypted form and back. The SDK handles approvals, encryption, and the two-step unshield flow.

### Confidential transfers

Encrypt amounts client-side before submitting on-chain. On-chain observers see the transaction but never the value.

### React hooks

TanStack Query-based hooks with cached decryption, automatic cache invalidation, and one-signature session management.

## Two packages, one import

| Package                                                                                                  | Use when...                                                                   |
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [`@zama-fhe/sdk`](https://github.com/zama-ai/sdk/blob/main/reference/sdk/ZamaSDK/README.md)              | You are building with vanilla TypeScript, Node.js, or any non-React framework |
| [`@zama-fhe/react-sdk`](https://github.com/zama-ai/sdk/blob/main/reference/react/ZamaProvider/README.md) | You are building a React app (includes everything from the core SDK)          |

If you are using React, `@zama-fhe/react-sdk` re-exports most of the core SDK (hooks, providers, `RelayerWeb`, storage singletons). You still import signer adapters from their sub-paths (e.g. `@zama-fhe/sdk/viem`, `@zama-fhe/sdk/ethers`).

## Install

{% tabs %}
{% tab title="pnpm" %}

```sh
# React app
pnpm add @zama-fhe/react-sdk @tanstack/react-query

# Vanilla TypeScript / Node.js
pnpm add @zama-fhe/sdk
```

{% endtab %}

{% tab title="npm" %}

```sh
# React app
npm install @zama-fhe/react-sdk @tanstack/react-query

# Vanilla TypeScript / Node.js
npm install @zama-fhe/sdk
```

{% endtab %}

{% tab title="yarn" %}

```sh
# React app
yarn add @zama-fhe/react-sdk @tanstack/react-query

# Vanilla TypeScript / Node.js
yarn add @zama-fhe/sdk
```

{% endtab %}
{% endtabs %}

## Your first confidential transfer in 30 seconds

```ts
import { ZamaSDK, RelayerWeb, indexedDBStorage } from "@zama-fhe/sdk";
import { ViemSigner } from "@zama-fhe/sdk/viem";

const sdk = new ZamaSDK({
  relayer: new RelayerWeb({
    getChainId: () => signer.getChainId(),
    transports: {
      [1]: {
        relayerUrl: "https://your-app.com/api/relayer/1",
        network: "https://mainnet.infura.io/v3/YOUR_KEY",
      },
      [11155111]: {
        relayerUrl: "https://your-app.com/api/relayer/11155111",
        network: "https://sepolia.infura.io/v3/YOUR_KEY",
      },
    },
  }),
  signer: new ViemSigner({ walletClient, publicClient }),
  storage: indexedDBStorage,
});

const token = sdk.createToken("0xYourEncryptedERC20");

await token.shield(1000n); // deposit public tokens
const balance = await token.balanceOf(); // decrypt your balance
await token.confidentialTransfer("0xRecipient", 500n); // private send
await token.unshield(500n); // withdraw back to public
```

Ready to build? Jump to the [Quick start](https://github.com/zama-ai/sdk/blob/main/tutorials/quick-start/README.md) for a full working example with your stack.

## Help center

Ask technical questions and discuss with the community.

* [Community forum](https://community.zama.ai/c/zama-protocol/15)
* [Discord channel](https://discord.com/invite/zama)


---

# 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.zama.org/protocol/sdk/overview.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.
