Skip to main content
Same useRaykoiForm hook as React — this page covers Next.js-specific placement and an optional server-side pattern.

App Router

useRaykoiForm is a hook, so the component that calls it needs 'use client' — same rule as any other stateful hook, not something Raykoi adds on top. Keep that component in its own file and import it into your (unchanged) Server Component page:
Beyond that one standard React Server Components boundary, there’s nothing Raykoi-specific to configure — no provider, no root-layout wrapper, no next.config.js changes.

Pages Router

Every component renders client-side by default (no Server/Client Component split), so useRaykoiForm works with zero setup — identical usage to plain React.

Submitting from a Server Action

A Server Action runs on your server, so it can authenticate with a secret API key and skip the CAPTCHA gate entirely — the same pattern as Node.js, using the canonical form-scoped client:
This bypasses the point of a client-submitted form — CAPTCHA, quota checks tied to the visitor’s own identity, and network-failure retries all assume the browser is the one calling submit(). Reach for a Server Action only when you deliberately want server-authenticated submission (e.g. gating behind your own app’s auth), not as the default Next.js pattern — useRaykoiForm above is that default.
Using Remix or another React meta-framework instead? See Meta-Frameworks.