Ask an agent
Add this skill and ask your agent to convert your web app to a mini app using the steps outlined in this guide.1. Install MiniKit
2. Disable SSR
MiniKit depends onwindow.WorldApp. SSR causes hydration mismatches that silently break event handlers.
src/app/page.tsx
3. Add MiniKitProvider
src/app/providers.tsx
src/app/layout.tsx
4. Wallet Connection
UsegetWorldAppProvider() inside World App, fall back to window.ethereum for browsers.
getWorldAppProvider() maps:
eth_requestAccounts→MiniKit.walletAuth()eth_sendTransaction→MiniKit.sendTransaction()eth_chainId→0x1e0(World Chain 480)
writeContract / readContract calls work unchanged.
5. Bundle Approve + Contract Calls
World App resets approvals to 0 after each transaction. A separateapprove() tx followed by transferFrom() in the next tx will fail.
Bundle them in one call:
6. Handle userOpHash Receipts
MiniKit returns auserOpHash, not a standard tx hash. Use useUserOperationReceipt from @worldcoin/minikit-react to poll for the receipt:
7. Whitelist Contracts and Tokens
In Developer Portal > Mini App > Permissions, add:- Permit2 Tokens — every ERC-20 your app transfers
- Contract Entrypoints — every contract your app calls
invalid_contract.
Common Gotchas
| Issue | Symptom | Fix |
|---|---|---|
| SSR hydration mismatch | Clicks do nothing | dynamic(..., { ssr: false }) |
| Approval reset after tx | transferFrom reverts | Bundle approve + call in one sendTransaction |
userOpHash not a tx hash | waitForTransactionReceipt times out | Use useUserOperationReceipt from @worldcoin/minikit-react |
| Missing contract whitelist | invalid_contract error | Add to Developer Portal |