worldcoin/minikit-js/web-to-miniapp
Claude Code and agent skill by worldcoin/minikit-js
- community
Checking that the SKILL.md file is still in the repository.
Use this skill when you are asked to adapt an existing web app to work as a World App mini app, or to share code between a web app and a mini app. This skill covers the technical steps of migration, common issues, and debugging tips. There will be some changes required to contracts and frontend code, but the overall architecture and user experience can remain largely unchanged.
Install
npx vskill@latest install worldcoin/minikit-js/web-to-miniappSKILL.md
Migrate Next.js Web App to World App Mini App
You are converting an existing Next.js web app that uses viem to work as a World App mini app. Follow these steps in order.
Step 1 — Install MiniKit
Step 2 — Disable SSR for pages that use MiniKit
MiniKit depends on window.WorldApp which doesn't exist on the server. SSR causes hydration mismatches that silently break all React event handlers — buttons render but do nothing.
Wrap the page component in a dynamic import with ssr: false:
Move the actual page logic into src/components/App.tsx.
Step 3 — Add MiniKitProvider
Create src/app/providers.tsx:
Wrap children in src/app/layout.tsx:
Step 4 — Dual-provider wallet connection
Detect World App with MiniKit.isInWorldApp() and use getWorldAppProvider() as the EIP-1193 provider. Fall back to window.ethereum for browser wallets.
getWorldAppProvider() is a standard EIP-1193 provider. Under the hood:
eth_requestAccounts→MiniKit.walletAuth()(SIWE sign-in)eth_sendTransaction→MiniKit.sendTransaction()(returnsuserOpHash)eth_chainId→0x1e0(World Chain 480)
All existing writeContract / readContract calls work unchanged through this provider.
Step 5 — Bundle Approve with Contract Calls
World App resets token approvals to 0 after each transaction. A separate approve() followed by a transferFrom() in the next tx will fail, the approval is already gone. Thus you should bundle the approval and your contract call in a single sendTransaction:
In World App, these execute atomically. On web, they execute sequentially — each requires a separate wallet confirmation and is not atomic.
Step 6 — Handle userOpHash receipts
MiniKit returns a userOpHash, not a standard tx hash. Use useUserOperationReceipt from @worldcoin/minikit-react to poll for the receipt:
Step 7 — Whitelist contracts and tokens
In the Developer Portal > Mini App > Permissions, add:
- Permit2 Tokens — every ERC-20 your app transfers
- Contract Entrypoints — every contract your app calls directly
Transactions touching non-whitelisted contracts are blocked with invalid_contract.
| Issue | Symptom | Fix | |
|---|---|---|---|
| SSR hydration mismatch | Buttons render but clicks do nothing | dynamic(..., { ssr: false }) | |
MiniKit.isInstalled() before install() | Always false even in World App | Use useMiniKit() hook or window.WorldApp | |
Permit2 uses uint160 amounts | Silent overflow | Cast explicitly | |
eth_sendTransaction returns userOpHash | waitForTransactionReceipt times out | Use useUserOperationReceipt from @worldcoin/minikit-react | |
| Missing contract whitelist | invalid_contract error | Add to Developer Portal permissions |
Tip: Debugging in the webview
There are no browser devtools in World App's webview. Add eruda for a mobile console:
Bonus: Think about World ID
Think about places where you could use privacy preserving sybil resistance with World ID. The World ID SDK
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/web-to-miniapp/SKILL.md
Popularity
- Repository stars
- 87
- Repository forks
- 74
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/worldcoin/minikit-js/web-to-miniapp)