Repository navigation
v0.1.0
Added
<Captcha>, one component for every provider:builtin(the default),turnstile,
recaptcha-v2,recaptcha-v3andhcaptcha. Takes fancy-captcha's server props
(config), orprovider/siteKey/action/namedirectly. Exposes the token through
onTokenand a hidden form field.useCaptcha()for headless use: values, status, progress,widgetRef,reset(),
cancel().- Works with Inertia's
useForm()and fancy-inertia'suseFancyForm()throughform
(anything withdataandsetData(key, value)), and with a plain<form>.
captchaData(config)seeds a form's data. - Reset when consumed. Clearing the token or solution (as
form.reset()does after a
submit) resets the widget, re-executes reCAPTCHA v3 or solves a fresh challenge. Expiry and
errors clear the token. - Lazy, SSR-safe script loading: in an effect, once per URL for any number of widgets,
reusing an API already on the page.scriptUrlfor a self-hosted copy. - Built-in mode: an off-screen honeypot hidden from assistive tech and the keyboard, the
signed timestamp, and proof-of-work solved in a Web Worker built from a Blob (main-thread
slices when a Worker cannot be made), with a progress bar, a polite live region and
cancellation. Challenges outside 8..32 bits are refused. - Optional consent gating with fancy-compliance-ui, structurally typed so it is not a
dependency: a gated provider renders only after its category is granted, with the built-in
check (and proof-of-work) as the fallback. - RTL through
diror inheritance; AAA where we control it. Read-only
data-fancy-captcha-*handles andonStatusChangefor agents, which must never solve a
captcha. CAPTCHA_FIELDS, the same field names as the server'sFancyCaptcha\Fields.
Consumer action: new package. Install it with particle-academy/fancy-captcha on the
server, add the @source line for Tailwind, and add worker-src blob: if you run a strict CSP
and want proof-of-work off the main thread.