FCaptcha
FCaptcha copied to clipboard
Example: Next.js App Router form with server-side verification
examples/ has runnable integrations for Hono, Supabase, FastAPI and a plain Node contact form. A Next.js (App Router) example would cover a lot of people.
What to do
Add examples/nextjs/ with:
- a page with a form that renders the checkbox widget (load
fcaptcha.jswithnext/script, or render it in a client component) - a server action or route handler that verifies the posted
fcaptcha_tokenagainst/turnstile/v0/siteverify(or/api/token/verify) and rejects the submission if it fails - a README with how to run it against a local FCaptcha server (
docker run … ghcr.io/webdecoy/fcaptcha)
examples/hono/ and examples/fastapi/ show the shape, including tests for a replayed and a missing token.
Done when
The example runs from its README, and a link is added under "Runnable examples" in the main README.
I can take this. I'll add a runnable App Router form, server-side token verification, and tests for missing and replayed tokens.