React + Vite example using MetaMask Embedded Wallets (powered by Web3Auth) on StarkNet (Ethereum L2). After social login, the app derives an ed25519 key and uses the StarkNet provider to deploy a wallet, sign transactions, and interact with Cairo contracts.
- Node.js 20+
- npm
- A Client ID from the Dashboard
- StarkNet JSON-RPC endpoints (Mainnet and/or Sepolia) — a public Sepolia endpoint is pre-filled in
.env.example
git clone https://github.com/Web3Auth/web3auth-examples.git
cd web3auth-examples/other/starknet-examplenpm installcp .env.example .envEdit .env:
VITE_WEB3AUTH_CLIENT_ID=YOUR_CLIENT_ID
VITE_WEB3AUTH_CLIENT_ID_DEV=YOUR_DEVNET_CLIENT_ID
VITE_STARKNET_JSON_RPC_URL_MAINNET=YOUR_MAINNET_RPC_URL
VITE_STARKNET_JSON_RPC_URL_SEPOLIA=https://starknet-sepolia.public.blastapi.io/rpc/v0_8
npm run devVisit http://localhost:5173 in your browser.
MIT