React + Vite boilerplate for MetaMask Embedded Wallets (Web3Auth) + Solana Kit.
| Feature | Web3Auth (@web3auth/modal/react/solana) |
Solana Kit (src/solana/) |
|---|---|---|
| Login / logout | useWeb3AuthConnect, useWeb3AuthDisconnect |
— |
| Wallet address | useSolanaWallet → accounts |
— |
| Read chain / RPC | useSolanaWallet → rpc |
— |
| Sign message | useSignMessage |
— |
| Sign transaction | useSignTransaction |
buildSolTransferTransaction |
| Send transaction | useSignAndSendTransaction |
buildSolTransferTransaction |
| Switch chain | useSwitchChain + useWeb3Auth |
— |
| Solana React context | SolanaProvider (wraps app) |
— |
Kit is only used to build transfer transactions and format lamports. Signing and RPC endpoints are handled by Web3Auth.
- Node.js 22.12+
- npm
- A Client ID from the Dashboard — add Solana chain(s) under Chains & Networks (RPC URLs come from the dashboard; this app does not hardcode them)
git clone https://github.com/Web3Auth/web3auth-examples.git
cd web3auth-examples/quick-starts/react-solana-quick-startnpm installcp .env.example .envEdit .env and set your Client ID:
VITE_WEB3AUTH_CLIENT_ID=YOUR_CLIENT_ID
npm run devVisit http://localhost:5173 in your browser.
Use Sapphire Devnet (the default) for local development. Sapphire Mainnet does not allow localhost.
src/
solana/transfer.ts # Kit: build a SOL transfer transaction
components/ # Web3Auth Solana hooks (one component per action)
web3authContext.tsx
main.tsx # Web3AuthProvider + SolanaProvider
- Build with AI — set up the MCP server and skill for AI-assisted integration
- Dashboard — Chains and Networks
- Solana Kit — Getting started
- Solana Kit — Sending transactions
- MetaMask Embedded Wallets — Solana
- React SDK
- Dashboard
MIT