Mini Apps in Coinbase Wallet
Guide for building and optimizing mini apps for Coinbase Wallet
We’re so excited that mini apps are coming to Coinbase Wallet! The purpose of this guide is to go over how to build or update your mini app so it works as well as possible in Coinbase Wallet.
Using MiniKit
Quick Start with MiniKit
If you use MiniKit and/or follow the MiniKit quickstart guide, your mini app will work out of the box in Coinbase Wallet!
For reference, MiniKit is easiest way to build mini apps on Base, allowing developers to easily build mini apps without needing to know the details of the SDK implementation. It integrates seamlessly with OnchainKit components and provides Coinbase Wallet-specific hooks.
Debugging Guide
If you’re already using MiniKit and experiencing issues, you can refer to our debugging guide
Authentication
As a general rule of thumb for building any mini app, we recommend that you do not automatically request that the user logs in/signs a message and instead that authentication is only used when it’s needed (e.g. signing up for an event, viewing authenticated resources, etc).
Below we will quickly cover the different methods of authentication offered for mini apps and how well each of them work in Coinbase Wallet:
Because users in Coinbase Wallet have an in-app smart wallet that doesn’t require any app switching, we recommend wallet authentication as the primary method of authentication for developers looking to create a persisted session for the mini app user.
As described below, we don’t think it’s the best practice to prompt the user to log in before that authentication will allow them to do something else in your mini app, but for cases where do you want a secure, persisted session, using a wallet connection is a great option.
Because users in Coinbase Wallet have an in-app smart wallet that doesn’t require any app switching, we recommend wallet authentication as the primary method of authentication for developers looking to create a persisted session for the mini app user.
As described below, we don’t think it’s the best practice to prompt the user to log in before that authentication will allow them to do something else in your mini app, but for cases where do you want a secure, persisted session, using a wallet connection is a great option.
All mini app host apps (including Coinbase Wallet) return context data, which tells developers about the app/mini app host the user is accessing their mini app in, as well as which user is interacting with their mini app.
A common flow that other mini app developers follow is using the context data to either track analytics metrics or create an authentication session via a JWT. This allows you to still track analytics/offer certain authenticated services to your users without the extra friction of signing a message or deeplinking to another app.
Something important to note is that because of how the current mini app spec is written, context data can technically be spoofed by any developer who makes their own mini app host. Because of this, we recommend that context data is not used as the primary method of authentication.
Currently, using Sign In with Farcaster inside of Coinbase Wallet is not recommended as the primary method of authentication. This is because, for Farcaster accounts that were created in Warpcast (which many current accounts were), using Sign In with Farcaster will require deeplinking the user to Warpcast and then back to Coinbase Wallet. While this flow still works inside of Coinbase Wallet, we recommend either wallet auth or creating an auth strategy around the context data (eg. a custom JWT with context data) for a more optimal UX.
Note: The Sign In with Farcaster flow will no longer require a deeplink to Warpcast when the auth addresses FIP lands, which will allow a set of delegated wallets to take actions on behalf of a Farcaster account’s custody wallet.
Deeplinks and SDK Actions
The official mini apps SDK offers a set of actions (which MiniKit offers as well) so that users of your mini app can be led to do things back in clients like Coinbase Wallet (e.g. compose a cast, view a profile, etc).
Always use official SDK functions instead of Warpcast-specific deeplinks in your mini app.
While some developers have used Warpcast-specific deeplinks in the openUrl
function as a workaround, this approach can create problems. Warpcast-specific deeplinks might not match Coinbase Wallet-specific deeplinks, potentially leaving users dead-ended and unable to take further action in your mini app.
Using the official SDK functions ensures your users have the best viewing experience possible across all supported clients, including Coinbase Wallet.
Note: For developers who include a “Share” button in their miniapp, we recommend that you move over to the new composeCast
function in the miniapps SDK instead of using a Warpcast-specific deeplink.
Wallet Interactions
Wallet interactions are a core part of the miniapp experience. We want to ensure both that building wallet interactions on top of the Coinbase Wallet is smooth for developers and that users can choose/have funds sent to their Coinbase Wallet when interacting with mini apps.
As a mini app host, we expose an EIP-1193 Ethereum Provider that can be accessed in two primary ways:
By using the Wallet component offered in OnchainKit/MiniKit
If you run npm create onchain --mini
, your mini app will have a “Connect Wallet” button already set up
By using the Wallet component offered in OnchainKit/MiniKit
If you run npm create onchain --mini
, your mini app will have a “Connect Wallet” button already set up
By using either sdk.wallet.getEthereumProvider()
from @farcaster/frame-sdk or by using @farcaster/frame-wagmi-connector with your Wagmi config
Metadata
Farcaster has recently extended the metadata spec for mini apps, which allows developers to add screenshot links, categories, and more to their manifest (farcaster.json) file. Making use of these new metadata fields is highly recommended for increasing the chance that your mini app could be featured throughout Coinbase Wallet.
Below is a table of the new metadata fields introduced, what they mean/could potentially be used for, and an example of what a manifest file could look like with these new fields (all taken from the official spec)
Note: Only ~30 of the hundreds of mini apps we’ve seen have set this data, we highly recommend that you set this metadata as it will give your mini app a better shot at being featured.
Example Manifest
Notifications
You will soon be able to send notifications from your Mini App that will appear in Coinbase Wallet. These notifications help re-engage users when something important happens, like a new drop, an update, or a reminder to complete an action. There are two ways to integrate:
The fastest way to start sending notifications. Neynar provides:
- A hosted webhook interface
- Built-in user token management (opt-in / opt-out)
- CLI tools and a dashboard
- Analytics out of the box
Get Started with Neynar
Learn how to integrate notifications using Neynar
The fastest way to start sending notifications. Neynar provides:
- A hosted webhook interface
- Built-in user token management (opt-in / opt-out)
- CLI tools and a dashboard
- Analytics out of the box
Get Started with Neynar
Learn how to integrate notifications using Neynar
You can self-host your own backend as long as it follows the Farcaster Mini App notification spec. This includes:
- Sending lifecycle events (
notification_enabled
,notification_disabled
) - Posting events to the expected format