Farcaster is a sufficiently decentralized social network whose core social graph is stored on-chain. Users can choose how content they create is stored and it enables unique, composable experiences by enabling users to link their accounts with a wallet of their choosing. Privy enables seamless login with your user’s Farcaster account within a Mini App. This means you can easily integrate Privy with Farcaster Mini Apps to compose experiences with a user’s existing social graph or network. Here’s how!Documentation Index
Fetch the complete documentation index at: https://docs.privy.io/llms.txt
Use this file to discover all available pages before exploring further.
Mini Apps starter
A starter repository for building a Farcaster Mini App with Privy and the Mini Apps SDK.
1. Enable Farcaster login in your dashboard
Go to your app in your developer dashboard and navigate to User management > Authentication > Socials. From here, enable Farcaster as a social option. This will enable you to configure Farcaster as a login and account linking option in your app.2. Configure your allowed domains and cookies
When building a Farcaster Mini App, you must include
https://farcaster.xyz as an allowed domain. Allowed domains is required for iframe-in-iframe which Farcaster uses, even for staging environments.Domains tab of your Configuration > App settings page in the developer dashboard and configure allowed domains for your app. This is the URL that your app is deployed to.
To use the embedded wallet, your application must also include https://farcaster.xyz as an allowed domain. Including Farcaster as an allowed domain allows the Privy iframe, where the embedded wallet is hosted, to load in the Farcaster browser app.
Currently Mini Apps do not support httpOnly cookies. If you have httpOnly cookies enabled for your app, it is recommended to set up an appClient to override the default cookie settings. Learn more about appClients here.
3. Configure your app’s Farcaster integration
The following assumes you have set up Privy with your app. If you haven’t, start by following the instructions in the Privy Quickstart to get your app set up with Privy. Be sure to configure'farcaster' as an upfront login method in your PrivyProvider, like so:
4. Setup seamless Farcaster login with the Mini Apps SDK
Use
loginToMiniApp from useLoginToMiniApp for proper Farcaster Mini App authentication (not
Farcaster’s quick auth).loginToMiniApp from useLoginToMiniApp. This can be done by fetching a signature from an external wallet, the Farcaster Wallet, or in an app with mini app support (such as the Base app) by calling miniappSdk.actions.signIn.
Farcaster object, including their fid, username, pfp and more, in the user object returned by the usePrivy hook.
That’s it! You can now use this to power composable experiences in your new Mini App. When building out your Mini App, be sure to visit Farcaster’s resources page for help with testing and common issues!
