Solana Web3.js
Official JavaScript SDK for interacting with the Solana blockchain.
3. Used by agents' projects
Dependency in 25 public GitHub projects set up for AI coding agents that we scanned (0.4%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Solana Web3.js does
The v3 line keeps the class-based API that v1 users know but rebuilds its internals on Solana Kit, and the repo ships an agent skill for moving code from v1 to v3.
Solana Web3.js popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Solana Web3.js is used
- Solana Web3.js is a dependency in 25 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.5% of the 4,867 JavaScript/TypeScript ones), #3 of 155 in crypto and web3.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 2,380; those are left out of every share on this page.
- The most used alternative in our scan is ethers.js (30 projects).
- Projects that use it most often also use dotenv (60.0%), Solana SPL Token (44.0%), Zod (60.0%).
By coding agent
Often used with
Solana Web3.js in practice
Strengths
Upgrading to v3 does not mean learning a new programming model. The docs say v3 keeps the class-based API and swaps the internals for Solana Kit.
The repo includes a skill that coding agents can use to migrate an app, alongside a human-facing guide. You install it with <code>npx skills add</code>, either from a local checkout or straight from the GitHub path.
v3 publishes separate builds for Node.js, browsers and React Native. For pages with no bundler there are minified and unminified IIFE bundles on unpkg.
The docs send readers to the Solana Cookbook for guides organised by task, and to the API documentation for individual functions.
Watch out for
Code written against v1 is on a branch that receives critical fixes only. New development happens on v3+.
The releases page lists v1.99.0 as the latest release. Install the v3 range explicitly (<code>@solana/web3.js@3</code>) if that is the line you want.
Browser support covers modern evergreen browsers with BigInt. Older browsers are only reachable if your app transpiles and polyfills the package itself.
Install v3
npm install @solana/web3.js@3
pnpm add @solana/web3.js@3
bun add @solana/web3.js@3
yarn add @solana/web3.js@3More about Solana Web3.js
Packages around it
- @solana/spl-token: SPL token client
- @solana/wallet-adapter-react: Wallet adapter for React
- @coral-xyz: Anchor client packages
- @metaplex-foundation: Metaplex SDKs
- dotenv: Env file loader
- ts-node: Run TypeScript in Node
Alternatives
Solana Web3.js This page
Complete Ethereum library for building dapps, wallets and blockchain tools.
Solana JavaScript SDK for building web3 applications on the Solana blockchain.
Get started
Install it.
npm install @solana/web3.jsRules for your agent
## Solana Web3.js
- Target v3 for new code: install `@solana/web3.js@3`. v1 (`maintenance/v1.x`) receives critical fixes only.
- To upgrade a v1 app, use the official skill: `npx skills add https://github.com/solana-foundation/solana-web3.js/tree/main/skills/web3js-v1-to-v3-migration`.
- Require Node 20.18.0 or newer, and runtimes with BigInt support (Hermes on React Native).
- When loading the IIFE bundle from unpkg in production, pin an exact version instead of the `@3` range.
- Do not promise support for older browsers unless the app transpiles and polyfills the package itself.
- Integration tests need a local validator: run `pnpm --filter @solana/web3.js run test:live-with-test-validator:setup` first.
- Check the Solana Cookbook for task recipes and the API Documentation for individual functions.