Option A: Download from website (Recommended)
- Go to https://ngrok.com/download
- Download for macOS
- Extract and move to a location in your PATH, or use it directly
Option B: Using the downloaded file If the download worked, extract it:
unzip ngrok.zip
chmod +x ngrok
sudo mv ngrok /usr/local/bin/ # or add to your PATHIn one terminal, start your Next.js dev server:
pnpm devThis will run on http://localhost:3000
In another terminal, run:
ngrok http 3000This will give you a URL like: https://abc123.ngrok-free.app
IMPORTANT: Your webhook URL should be:
https://your-ngrok-url.ngrok-free.app/api/farcaster-webhook
NOT /farcaster/webhook - use /api/farcaster-webhook
- Go to Neynar Dashboard → Webhooks
- Click "New webhook" or edit existing
- Set Target URL to:
https://your-ngrok-url.ngrok-free.app/api/farcaster-webhook - Configure Event Types:
- Select
cast.created
- Select
- Set Filters:
- Mentioned users: Add your bot's Farcaster username (e.g.,
daemonagent) - Parent cast authors: Add your bot's Farcaster username
- Mentioned users: Add your bot's Farcaster username (e.g.,
- Set Webhook Secret (optional but recommended):
- Copy the secret and add it to your
.env.localasNEYNAR_WEBHOOK_SECRET
- Copy the secret and add it to your
- Make sure your dev server is running (
pnpm dev) - Make sure ngrok is running (
ngrok http 3000) - Copy the ngrok HTTPS URL (e.g.,
https://abc123.ngrok-free.app) - Update Neynar webhook with:
https://abc123.ngrok-free.app/api/farcaster-webhook - Test by mentioning your bot on Farcaster
- Check your terminal logs for
[WEBHOOK] ====== REQUEST RECEIVED ======
- Sign up for a free ngrok account at https://dashboard.ngrok.com
- Get your authtoken
- Run:
ngrok config add-authtoken YOUR_TOKEN
- Verify the URL in Neynar is exactly:
https://your-url.ngrok-free.app/api/farcaster-webhook - Check that your dev server is running on port 3000
- Check ngrok is forwarding to port 3000
- Verify webhook is enabled in Neynar dashboard
- Check that
NEYNAR_WEBHOOK_SECRETin.env.localmatches the secret in Neynar - Or remove the secret from both sides to skip verification (not recommended)
# Terminal 1: Start dev server
pnpm dev
# Terminal 2: Start ngrok
ngrok http 3000
# Terminal 3: Test webhook endpoint
curl https://your-ngrok-url.ngrok-free.app/api/farcaster-webhook