# @solana/spl-token

> SPL Token Program JS API

Latest version **0.4.15** (published 2026-07-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @solana/spl-token
pnpm add @solana/spl-token
yarn add @solana/spl-token
bun add @solana/spl-token
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.15 |
| Published | 2026-07-09 |
| First published | 2020-07-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 5 |
| Unpacked size | 1.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 216 |
| Maintainers | solana-devs |

## Links

- npm: https://www.npmjs.com/package/@solana/spl-token
- Repository: https://github.com/solana-program/token-2022
- Homepage: https://github.com/solana-program/token-2022#readme
- Issues: https://github.com/solana-program/token-2022/issues
- npm.io page: https://npm.io/package/@solana/spl-token

## Dependencies (5)

- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [@solana/buffer-layout](https://npm.io/package/@solana/buffer-layout.md) ^4.0.0
- [@solana/spl-token-group](https://npm.io/package/@solana/spl-token-group.md) ^0.0.7
- [@solana/spl-token-metadata](https://npm.io/package/@solana/spl-token-metadata.md) ^0.1.6
- [@solana/buffer-layout-utils](https://npm.io/package/@solana/buffer-layout-utils.md) ^0.3.0

## Recent versions

- 0.4.15 (latest) — 2026-07-09
- 0.3.4-alpha.0 (alpha) — 2022-08-24
- 0.2.0-alpha.2 (next) — 2022-01-22
- 0.4.14 — 2025-09-02
- 0.4.13 — 2025-03-04
- 0.4.12 — 2025-01-30
- 0.4.11 — 2025-01-28
- 0.4.10 — 2025-01-28
- 0.4.9 — 2024-10-17
- 0.4.8 — 2024-07-09
- 0.4.7 — 2024-06-25
- 0.4.6 — 2024-04-19
- 0.4.5 — 2024-04-19
- 0.4.4 — 2024-04-18
- 0.4.3 — 2024-03-23
- … 38 more at https://npm.io/package/@solana/spl-token/versions

## README

# `@solana/spl-token`

A TypeScript library for interacting with the SPL Token and Token-2022 programs.

> [!IMPORTANT]  
> If you are using [@solana/web3.js version 2](https://github.com/solana-labs/solana-web3.js/?tab=readme-ov-file#whats-new-in-version-20)
> , you should use the `@solana-program/token` and `@solana-program/token-2022` 
> packages instead.

## Links

- [TypeScript Docs](https://solana-labs.github.io/solana-program-library/token/js/)
- [FAQs (Frequently Asked Questions)](#faqs)
- [Install](#install)
- [Build from Source](#build-from-source)

## FAQs

### How can I get support?

Please ask questions in the Solana Stack Exchange: https://solana.stackexchange.com/

If you've found a bug or you'd like to request a feature, please
[open an issue](https://github.com/solana-labs/solana-program-library/issues/new).

### No export named Token

Please see [upgrading from 0.1.x](#upgrading-from-01x).

## Install

```shell
npm install --save @solana/spl-token @solana/web3.js@1
```
_OR_
```shell
yarn add @solana/spl-token @solana/web3.js@1
```

## Build from Source

0. Prerequisites

* Node 16+
* PNPM

If you have Node 16+, you can [activate PNPM with Corepack](https://pnpm.io/installation#using-corepack).

1. Clone the project:
```shell
git clone https://github.com/solana-program/token-2022.git
```

2. Navigate to the root of the repository:
```shell
cd token-2022
```

3. Build the on-chain programs:
```shell
make build-sbf-program
make build-sbf-confidential-elgamal-registry
```

4. Navigate to the SPL Token library:
```shell
cd clients/js-legacy
```

5. Build the libraries in the repository:
```shell
pnpm install
pnpm run build
```

6. Run the tests:
```shell
pnpm run test
```

7. Run the example:
```shell
pnpm run example
```

## Upgrading

### Upgrading from 0.2.0

There are no breaking changes from 0.2.0, only new functionality for Token-2022.

### Upgrading from 0.1.x

When upgrading from spl-token 0.1.x, you may see the following error in your code:

```
import {TOKEN_PROGRAM_ID, Token, AccountLayout} from '@solana/spl-token';
                          ^^^^^
SyntaxError: The requested module '@solana/spl-token' does not provide an export named 'Token'
```

The `@solana/spl-token` library as of version 0.2.0 does not have the `Token`
class. Instead the actions are split up and exported separately.

To use the old version, install it with:

```
npm install @solana/spl-token@0.1.8
```

Otherwise you can find documentation on how to use new versions on the
[SPL docs](https://spl.solana.com/token) or
[Solana Cookbook](https://solanacookbook.com/references/token.html).

---
_Source: https://npm.io/package/@solana/spl-token · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
