Skip to content
Set up a minimal Solana wallet integration in Next.js (App Router) with @solana/kit, the kit plugins, and @solana/react. You’ll create a connect wallet dropdown and a SOL transfer component.
Next.js Kit App
Next.js Kit App

​Resources

​Prerequisites

  • Node.js 20.18 or later (the floor @solana/kit declares)
  • npm

​Create Next.js Project

Terminal
When prompted, accept all defaults (the starter includes Tailwind, which this tutorial uses for simple utility styles).
Two scaffold tweaksThe default create-next-app output needs two small changes for this tutorial:
  • In tsconfig.json, set "target": "ES2020" (or later). The transfer amounts use bigint literals such as 1_000_000_000n, which require ES2020.
  • In app/globals.css, remove the generated @media (prefers-color-scheme: dark) block and the body background rule. This UI is light-only; the dark defaults otherwise override the bg-white utility and render the page unreadable in dark mode.

​Install Solana dependencies

Terminal
react@latest react-dom@latest keeps React at or above the version @solana/kit-plugin-wallet expects (19.3.1 or later for 0.23). Without it, npm can stop with an ERESOLVE error when create-next-app pinned an older React. This tutorial targets Kit 7+, the @solana/kit-plugin-* packages at 0.13+ (0.14+ for @solana/kit-plugin-wallet), and @solana/react 7+.
1

1. Create Solana Provider

app/providers.tsx builds one client at module scope and publishes it with ClientProvider. The walletSigner plugin makes the connected wallet the fee payer and identity; export the client type so components can type useClient.
app/providers.tsx
2

2. Update Layout

Wrap your application with the Providers component. Update app/layout.tsx to import and use it:
app/layout.tsx
This wraps the entire app with the Solana context so all child components can access the client and wallet hooks.
3

3. Wallet Connect Button

Dropdown to connect/disconnect Wallet Standard wallets. useWallets returns the wallets discovered in the browser; useConnect / useDisconnect return an ActionResult — this component uses its dispatch, isRunning, and error fields. Every wallet hook takes the client as its first argument, so pull it from useClient<AppClient>() first.
app/components/wallet-connect-button.tsx
Wallet dropdown options
Wallet dropdown options
Wallet dropdown connected
Wallet dropdown connected
4

4. SOL Transfer

Build a transfer instruction with @solana-program/system and send it through client.sendTransaction. The connected wallet signs and pays.
app/components/sol-transfer-card.tsx
SOL transfer form filled
SOL transfer form filled
SOL transfer success
SOL transfer success
Wallets come from Wallet Standard discovery; once connected, the SOL transfer uses the connected signer as the fee payer.
5

5. Page

app/page.tsx renders the wallet connect and SOL transfer components:
app/page.tsx
6

6. Run the Application

Terminal
Open http://localhost:3000, connect a devnet wallet, and send a SOL transfer. The wallet pays the fee and the amount, so fund its devnet address from the Solana Faucet first.