# Solana Web3.js — card for AI agents

Official JavaScript SDK for interacting with the Solana blockchain.

Category: Crypto and web3 · npm package `@solana/web3.js` · latest version 3.1.1 (checked 2026-11-01)
Install: `npm install @solana/web3.js`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## 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.

## What it is
- `@solana/web3.js` is the Solana JavaScript SDK. The docs say to use it "to interact with accounts and programs on the Solana network through the Solana JSON RPC API". The repo was created in 2018 and is MIT licensed.
- The current branch tracks v3. The maintainers write that it "keeps the familiar class-based API, updates it for the latest RPC methods, and rebuilds the internals on Solana Kit." v1 lives on a `maintenance/v1.x` branch and gets critical fixes only. v3 ships separate builds for Node.js, browsers and React Native. You can also load it with a plain `<script>` tag from unpkg, with no build step.
- The repository is a pnpm workspace. It also holds `@solana/wallet-adapter`, and each package is versioned and published on its own. For task-level help, the docs point to the Solana Cookbook and the generated API documentation.

## Caveats
- v1 is in maintenance mode: Code written against v1 is on a branch that receives critical fixes only. New development happens on v3+.
- Latest GitHub release is still a v1 tag: The releases page lists v1.99.0 as the latest release. Install the v3 range explicitly (`@solana/web3.js@3`) if that is the line you want.
- BigInt required, no legacy browsers: Browser support covers modern evergreen browsers with BigInt. Older browsers are only reachable if your app transpiles and polyfills the package itself.
- The @3 CDN range moves under you: The unpkg URL with `@3` resolves to whatever v3 release is newest. The docs tell you to pin an exact version for production.
- Runtimes outside the list are unsupported: Anything other than Node 20.18.0+, evergreen browsers and BigInt-capable React Native may work, but the docs place it outside the compatibility contract.

## Numbers (AgentGid data)
- Gid Score: 67.9 (#491 of all tools, 3 of 155 in its category)
- Used in 25 public projects set up for AI coding agents (0.4%)
- Downloads last week: 3,699,315 (as of 2026-11-24), +34.5% over 4 weeks
- GitHub stars: 2,781 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
dotenv 60.0%, Solana SPL Token 44.0%, Zod 60.0%, uuid 28.0%, Testing Library 32.0%, Supabase JS 32.0%

## Checked alternatives (same job)
- ethers.js: https://agentgid.com/tools/ethers/agent.md
- Solana Kit: https://agentgid.com/tools/solana-kit/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/solana-web3-js/
- Homepage: https://solana.com/
- Repository: https://github.com/solana-foundation/solana-web3.js
- Source: https://github.com/solana-foundation/solana-web3.js#readme
- Source: https://github.com/solana-foundation/solana-web3.js
- Source: https://github.com/solana-foundation/solana-web3.js/releases
- Source: https://solana-foundation.github.io/solana-web3.js/

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
