← Protocols
Farcaster
01Description

Decentralised social protocol with an FID-based identity layer. Build Mini Apps and Frames that run inline in Warpcast and other clients, or read/write the social graph via Hubs / Snapchain.

02Best for
  • 01Mini Apps embedded in Warpcast
  • 02interactive Frames in casts
  • 03Sign In with Farcaster (SIWF)
  • 04social feeds / cast composers
  • 05consumer crypto distribution
03Install
  • pnpm add @farcaster/miniapp-sdk @farcaster/frame-sdk
  • pnpm add @neynar/nodejs-sdk # easiest read/write API; optional
04Environment variables
VariableScopeDescription
NEYNAR_API_KEYServerNeynar API key for hosted Farcaster reads/writes (cast feeds, signers, channels). Server-only.
NEXT_PUBLIC_FARCASTER_APP_FIDClientYour app's Farcaster FID — required to register signers on behalf of users via SIWF.
FARCASTER_APP_MNEMONICServerMnemonic for the custody wallet of the app FID, used to sign signed-key requests. Server-only.
05Prompt snippet
Build a Farcaster Mini App: import `sdk` from `@farcaster/miniapp-sdk`, call `await sdk.actions.ready()` once your UI mounts, and read user/client context from `sdk.context`. Add a `fc:miniapp` (and legacy `fc:frame`) meta tag with the manifest JSON pointing to your hosted `/.well-known/farcaster.json`. For interactive Frames v2, render an HTML page with `<meta name='fc:frame' content='...' />` containing image, button labels, and a post URL. To read/write the social graph, use Neynar's `@neynar/nodejs-sdk` (`client.publishCast`, `client.fetchFeed`, `client.lookupUserByFid`) with `NEYNAR_API_KEY`. For Sign In with Farcaster, use `@farcaster/auth-kit` and verify the SIWF message server-side against the on-chain key registry.
06Gotchas
  • Mini App vs Frame v1 vs Frame v2 are three different specs — Frame v1 is the legacy 4-button image format, Frame v2 / Mini Apps are full HTML apps. Ship the right meta tags for the experience you want.
  • Running your own Hub (Hubble / Snapchain node) takes significant disk and bandwidth; for most apps, use a hosted provider like Neynar or Pinata rather than self-hosting.
  • Writing casts requires a per-user signer key registered on-chain via the Key Registry — Neynar's managed-signer flow handles the signed-key-request UX for you.
  • Each user is a numeric FID, not a wallet — multiple wallets can verify against one FID. Always key your DB on FID, not on the connected wallet address.
  • Mini App image and embed URLs must be publicly reachable HTTPS and CSP-permissive; clients aggressively cache and proxy them.
  • `sdk.actions.ready()` must be called or Warpcast will keep the splash screen up indefinitely.
07Alternatives