Log in with Farcaster enables log in and read access to a user’s Farcaster account but does not
provide write access to the account today.
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 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. From there, if you’d like users to be able tologin
to your app with their Farcaster account, you can configure 'farcaster'
as an upfront login method in your PrivyProvider
, like so:
3. Use your Farcaster link to power custom logic
Once a user has logged in with or linked their Farcaster account, you can find theirFarcaster
object, including their fid
, username
, pfp
and more, in the user
object returned by the usePrivy
hook.
That’s it! Once you’ve linked a Farcaster account to a user object, you can use this to power composable experiences in your app. You should also consider using toolkits like Farcaster’s APIs or Neynar to query and interact with protocol data.
4. (Optional) Refresh Farcaster info
Sometimes, a user may update their Farcaster profile information (username
, pfp
) - while this is publicly available using a public hub endpoint, Privy caches a version whenever the user logs in for convenience. To refresh the Privy cache, you can use our REST API (server-auth
coming soon) and hitting the /api/v1/users/farcaster/refresh
endpoint.
getUserByFarcasterId
.
To be considerate of public hubs, we only allow refreshing of user data once every 24 hours. If you need more frequent than daily freshness, we recommend that you query public hub data using the user’s fid
.