For the complete one-shot LLM prompt, see
/llms-iframe-privy-multichain.txt.Tech Stack
- React (19+) with TypeScript
- Vite (6+) as build tool
- Tailwind CSS v4 for styling
- @privy-io/react-auth — authentication, embedded wallets, and smart wallets
- permissionless
"^0.3.3"— required by Privy’s smart wallet internals - viem — Ethereum interactions
- vite-plugin-node-polyfills — Privy requires Node.js polyfills in Vite
Critical Import Paths
Privy Provider Setup
Configuration Gotchas
1. showWalletUIs: false
Privy’s default shows a transaction simulation modal before every sendTransaction. Disable it when the wrapper handles the full tx flow.
2. Chain RPC URLs must use authenticated providers
Privy uses the chain’srpcUrls.default during Safe initialization. If it rate-limits, the smart wallet client silently stays undefined. Use Alchemy endpoints for supported chains.
3. Smart wallets are counterfactual
The address is valid before the contract exists on-chain. Do not callgetCode() or send dummy transactions — Privy deploys atomically on first real tx.
4. useCreateWallet() fallback
createOnLogin only fires during the login flow. Use useCreateWallet() as a runtime fallback for existing users who don’t have an embedded wallet yet.
5. Use getClientForChain for cross-chain tx
6. Privy Dashboard configuration
Each chain must have a bundler URL and Policy ID configured in the Privy Dashboard. Without this,getClientForChain returns undefined. See the Privy Integration guide for detailed dashboard setup instructions.
processBytecode Implementation
Environment Variables
Documentation References
- Iframe Overview — Protocol spec, query params, postMessage types
- wagmi + viem Wrapper — Alternative wrapper with browser wallets
- Privy Integration (Widgets) — Privy with React SDK widgets
- Privy docs
- viem docs