Privy supports Farcaster auth
addresses, including authentication
from The Base App. To authenticate a user, pass a Sign-In With Farcaster (SIWF) message signed by
an auth address to
loginToMiniApp
.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.
Use an appClient to override the default cookie
settings.
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).Privy now supports authentication with Farcaster auth addresses, including from the new Base app!
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
.
Automatic embedded wallet creation is currently not supported for Farcaster Mini Apps. You have
two options: use the wallet that clients like the Farcaster app and The Base App automatically
inject (recommended), or manually create embedded
wallets at your chosen onboarding point.
The Base App (TBA) Special Requirement: If your users are accessing your Mini App through The
Base App, they must add their The Base App Wallet address as an auth address to their Farcaster
account for authentication to work properly.
Always check that
ready
and authenticated
from the usePrivy
hook are true
before taking
actions!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!