Build a Farcaster MiniApp
Building a MiniApp comes with many benefits. You don’t need to manage on- and off‑ramp integrations, and the user experience is more seamless because your app runs inside a wallet client. For testing and scaling, we recommend keeping a standard wallet connection in your app; it should be hidden automatically when the app runs in a MiniApp environment. Our templates already include this setup, so we suggest creating your MiniApp using our starterkit, Celo Composer. Setting up a Farcaster MiniApp involves several specific settings, and our template provides a step‑by‑step guide to walk you through them. Before you start building a Farcaster MiniApp, we recommend watching this video on how to build a successful MiniApp on Farcaster.
Make sure to also read the Farcaster MiniApp documentation. You’ll save a lot of time by reviewing it in detail before building. We also recommend testing a few popular Farcaster MiniApps to get a feel for UX patterns.
Quick Start
Use this command to scaffold a Farcaster MiniApp quickly using the Celo Composer:SDK Installation and Setup
Install the MiniApp SDK
Install the Farcaster MiniApp SDK using your preferred package manager:Initialize the SDK
After your app loads, you must callsdk.actions.ready() to hide the splash screen and display your content:
Wallet Integration
Using Wagmi (Recommended)
The Mini App SDK exposes an EIP-1193 Ethereum Provider API atsdk.wallet.getEthereumProvider(). We recommend using Wagmi to connect to and interact with the user’s wallet.
Install the Wagmi Connector
Configure Wagmi
Add the Mini App connector to your Wagmi config:Connect to Wallet
If a user already has a connected wallet, the connector will automatically connect (e.g.,isConnected will be true). Always check for a connection and prompt users to connect if needed:
Your Mini App won’t need to show a wallet selection dialog that is common in a
web-based dapp. The Farcaster client hosting your app will take care of
getting the user connected to their preferred crypto wallet.
Send Transactions
You’re now ready to prompt the user to transact. They will be shown a preview of the transaction in their wallet and asked to confirm it:Batch Transactions (EIP-5792)
The Farcaster Wallet supports EIP-5792wallet_sendCalls, allowing you to batch multiple transactions into a single user confirmation. This improves UX by enabling operations like “approve and swap” in one step.
Common use cases include:
- Approving a token allowance and executing a swap
- Multiple NFT mints in one operation
- Complex DeFi interactions requiring multiple contract calls
Using Batch Transactions with Wagmi
Example: Token Approval and Swap
Limitations:
- Transactions execute sequentially, not atomically
- No paymaster support yet
- Available on all EVM chains Farcaster supports
Authentication
Quick Auth (Recommended)
Quick Auth is the easiest way to get an authenticated session for a user. It uses Sign in with Farcaster under the hood and returns a standard JWT that can be easily verified by your server.getToken() method stores the token in memory and returns it if not expired, otherwise fetches a new one.
Sign In with Farcaster
Alternatively, you can use thesignIn action to get a Sign in with Farcaster authentication credential:
verifySignInMessage. Apps can then issue a session token like a JWT for the remainder of the session.
Manifest Configuration
Mini Apps require a manifest file that describes your app. The manifest tells Farcaster clients how to display and interact with your app.Basic Manifest
Create amanifest.json file in your app’s root directory:
Required Fields
- name: Display name of your MiniApp
- description: Brief description of what your app does
- iconUrl: URL to your app’s icon (recommended: 512x512px)
- splashImageUrl: URL to splash screen image (recommended: 1920x1080px)
- splashBackgroundColor: Background color for splash screen (hex format)
- url: URL where your MiniApp is hosted
Optional Fields
- requiredChains: Array of chain IDs your app requires (e.g.,
[42220]for Celo) - requiredCapabilities: Array of required wallet capabilities
- homeUrl: URL to navigate when user taps home button
Deprecated Fields
The following fields are deprecated and should not be used:imageUrl(useiconUrlinstead)buttonTitle(no longer needed)
When
url is not provided in actionLaunchFrameSchema, it defaults to the
current webpage URL (including query parameters).
