# Kill any existing tunnels
pkill -f cloudflared
# Start new tunnel and save URL
cloudflared tunnel --url http://localhost:3000The tunnel will show output like:
+--------------------------------------------------------------------------------------------+
| Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
| https://your-unique-url.trycloudflare.com |
+--------------------------------------------------------------------------------------------+
- Copy the tunnel URL from terminal output
- Go to Clerk Dashboard
- Navigate to: Your Project → Webhooks
- Update endpoint URL to:
https://your-unique-url.trycloudflare.com/api/clerk/webhooks
❌ This doesn't work - Clerk webhooks need public URLs:
Clerk servers cannot reach http://localhost:3000/api/clerk/webhooks because localhost is not publicly accessible. You must use tunnels or public URLs.
Use a shared tunnel for the whole team:
- One person starts a tunnel and shares the URL
- Everyone uses the same webhook URL in Clerk
- All webhook events go to one person's machine
Each team member has their own tunnel:
- Each person runs their own tunnel
- Each person creates their own Clerk development project
- Each person configures their own webhook URL
-
Use Localhost Webhooks (Easiest):
# Each team member runs this npm run dev # Set Clerk webhook URL to: # http://localhost:3000/api/clerk/webhooks
-
Share Environment Variables:
# Create team .env file with shared credentials cp .env.example .env # Fill in shared API keys
-
Use Shared Database:
# Option A: Shared PostgreSQL (Railway/Supabase) DATABASE_URL=postgres://shared-db-url # Option B: Each person runs their own local database docker compose up -d npm run db:push
# Start tunnel
cloudflared tunnel --url http://localhost:3000
# Copy the URL and update Clerk webhook
# Then start development
npm run dev# One person runs tunnel and shares URL with team
cloudflared tunnel --url http://localhost:3000
# Set Clerk webhook URL to the tunnel URL (e.g.):
# https://unique-tunnel-url.trycloudflare.com/api/clerk/webhooks# Use same API keys for all team members
ANTHROPIC_API_KEY=shared_key
CLERK_SECRET_KEY=shared_key
CLERK_WEBHOOK_SECRET=shared_secret
RESEND_API_KEY=shared_key
UPLOADTHING_TOKEN=shared_token
# Use shared database
DATABASE_URL=postgres://shared-db-url
# Each person uses localhost
SERVER_URL=http://localhost:3000# Each person has their own Clerk project
CLERK_SECRET_KEY=individual_key
CLERK_WEBHOOK_SECRET=individual_secret
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=individual_key
# Each person runs their own database
DATABASE_URL=postgres://localhost:5432/hiresyncai
# Each person has their own tunnel URL
SERVER_URL=https://their-unique-tunnel.trycloudflare.com# If tunnel stops working
pkill -f cloudflared
cloudflared tunnel --url http://localhost:3000
# Update Clerk webhook URL with new tunnel URL# If webhooks not working for team members
# 1. Verify everyone is using the same Clerk webhook URL
# 2. Check that the tunnel owner's computer is running
# 3. Consider switching to localhost development- Use localhost for development (no tunnels needed)
- Share API keys in team chat or shared doc
- Use shared database for consistent data
- Document any environment changes in team chat
- Test webhooks after any URL changes
This approach eliminates tunnel complexity for team development while maintaining full functionality.