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

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# JavaScript/TypeScript SDK for Solana

> Learn how to interact with Solana using the JavaScript/TypeScript client libraries.

## Solana Kit

`@solana/kit` is the recommended TypeScript SDK for building on Solana. You
assemble a client from composable plugins, add React bindings when you need
them, and pull in generated program clients for the onchain programs you call.

| Package                   | Description                                  | GitHub                                                                                 |
| ------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------- |
| @solana/kit               | Core SDK: RPC, transactions, codecs, signers | [Source](https://github.com/anza-xyz/kit)                                              |
| @solana/react             | React bindings: `ClientProvider` and hooks   | [Source](https://github.com/anza-xyz/kit/tree/main/packages/react)                     |
| @solana/kit-plugin-rpc    | RPC connection + transaction sending         | [Source](https://github.com/anza-xyz/kit-plugins/tree/main/packages/kit-plugin-rpc)    |
| @solana/kit-plugin-signer | Fee payer, identity, and signer plugins      | [Source](https://github.com/anza-xyz/kit-plugins/tree/main/packages/kit-plugin-signer) |
| @solana/kit-plugin-wallet | Wallet Standard connection + React hooks     | [Source](https://github.com/anza-xyz/kit-plugins/tree/main/packages/kit-plugin-wallet) |

### Program clients

Generated clients that expose instruction builders and client plugins (for
example `tokenProgram()` → `client.token`).

| Package                        | Description                          | GitHub                                                                          |
| ------------------------------ | ------------------------------------ | ------------------------------------------------------------------------------- |
| @solana-program/system         | Interact with System program         | [Source](https://github.com/solana-program/system/tree/main/clients/js)         |
| @solana-program/token          | Interact with Token program          | [Source](https://github.com/solana-program/token/tree/main/clients/js)          |
| @solana-program/token-2022     | Interact with Token-2022 program     | [Source](https://github.com/solana-program/token-2022/tree/main/clients/js)     |
| @solana-program/memo           | Interact with Memo program           | [Source](https://github.com/solana-program/memo/tree/main/clients/js)           |
| @solana-program/compute-budget | Interact with Compute Budget program | [Source](https://github.com/solana-program/compute-budget/tree/main/clients/js) |

- [Official Kit Documentation](https://www.solanakit.com/)
- [All kit plugins](https://github.com/anza-xyz/kit-plugins)
- [Guide: Frontend with Kit](/developers/docs/frontend)
- [Tutorial: Next.js + Kit](/developers/docs/frontend/nextjs-solana)

## Signing & Key Management

For kit-compatible backend signing across multiple key management backends:

| Package          | Description                                                                                                                        | GitHub                                                         |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| @solana/keychain | Unified signing: Memory, Vault, Privy, Turnkey, AWS KMS, Fireblocks, GCP KMS, CDP, Para, Dfns, Crossmint, Openfort, Utila, Fordefi | [Source](https://github.com/solana-foundation/solana-keychain) |

See the [Keychain documentation](/developers/docs/tools/keychain) and
[Choosing a backend](/developers/docs/tools/keychain/choosing-a-backend) for setup and
custody-model guidance.

## Solana Web3.js v3

`@solana/web3.js` v3 is the recommended version of web3.js. It rebuilds the
classic class-based API — `Connection`, `Keypair`, `Transaction`, `PublicKey` —
on top of `@solana/kit` internals, so it works with Kit primitives and the
program clients above. Use it if you are upgrading an existing web3.js app or
prefer the class-based API.

Most methods that were synchronous in the legacy SDK, such as
`Keypair.generate()` and `transaction.sign()`, are now async.

```bash
npm install @solana/web3.js
```

| Package         | Description | GitHub                                                        |
| --------------- | ----------- | ------------------------------------------------------------- |
| @solana/web3.js | Core SDK    | [Source](https://github.com/solana-foundation/solana-web3.js) |

`@solana/spl-token` depends on `@solana/web3.js` (legacy) and does not run on
v3. Use `@solana-program/token` or `@solana-program/token-2022` instead; their
generated instructions and instruction plans work directly with v3's
`Transaction.add()`.

- [web3.js v1 → v3 migration guide](https://github.com/solana-foundation/solana-web3.js/blob/main/docs/web3js-v1-to-v3-migration.md)
- [spl-token migration guide](https://github.com/solana-foundation/solana-web3.js/blob/main/docs/web3js-spl-token-migration.md)

## Solana Web3.js (legacy)

`@solana/web3.js` (legacy, `1.x`) is the original TypeScript SDK for Solana.

<Warning>
  **`@solana/web3.js` 1.x is no longer actively maintained**

  It receives critical fixes only. Use [Kit](/developers/docs/clients/official/javascript#solana-kit) for new code. To migrate existing code, follow the [Kit upgrade guide](https://www.solanakit.com/docs/upgrade-guide), or the [web3.js v3 migration guide](https://github.com/solana-foundation/solana-web3.js/blob/main/docs/web3js-v1-to-v3-migration.md) to keep the class-based API.

  To run this code, install 1.x with `npm install @solana/web3.js@1`. A plain `npm install @solana/web3.js` installs v3, which this code doesn't run on.
</Warning>

<AccordionGroup>
<Accordion title="Legacy packages">

| Package           | Description                                                    | GitHub                                                                              |
| ----------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| @solana/web3.js   | Core SDK (`1.x`)                                               | [Source](https://github.com/solana-foundation/solana-web3.js/tree/maintenance/v1.x) |
| @solana/spl-token | Interact with Token, Token-2022, and Associated Token programs | [Source](https://github.com/solana-program/token-2022/tree/main/clients/js-legacy)  |
| @solana/spl-memo  | Interact with Memo program                                     | [Source](https://github.com/solana-program/memo/tree/main/clients/js-legacy)        |

- [Example: Connect a wallet with Next.js](/developers/cookbook/wallets/connect-wallet-react)

</Accordion>
</AccordionGroup>
