EU CAPTCHA for Next.js
Next.js is a React-based web framework developed by Vercel for building server-rendered and statically generated applications with built-in routing and performance optimisation. Protect your Next.js application from bots and form spam with a privacy-first, EU-hosted CAPTCHA supporting both App Router and Pages Router.
Why choose Myra EU CAPTCHA?
Interaction-free user experience
No puzzles, no clicks – invisible bot protection with zero user friction.
Digital sovereignty made in Germany
Fully GDPR-compliant, no cookies, no tracking – developed and hosted in Germany.
Intelligent threat detection
Smart protection trained by more than 100 billion daily Myra CDN signals.
Proven technology
Over 5 billion successfully secured authentication attempts.
How the integration works
1. Create an EU CAPTCHA account
Creating an account is completely free, all you need is a valid email address and you’re ready to go. Choose a plan that covers your needs. The first 3 months are free of charge.
Create an Account2. Create a sitekey
Create a sitekey in the EU CAPTCHA dashboard for the domain you want to protect. Provide a clear label so you can easily identify it later. This sitekey links the widget on your Next.js app to your EU CAPTCHA account.
3. Integrate EU CAPTCHA into your Next.js app
Install the package by running npm i @myrasec/eu-captcha, then share the integration guide with your developer. The widget must be placed inside a Client Component ('use client') as it requires browser APIs.
View integration guide4. Verify the token on your server
To finish the integration, validate the eu-captcha-response token in a Server Action or Route Handler before processing submissions.
View server-side guide
5. The EU CAPTCHA widget will appear in your Next.js application.
Frequently Asked Questions
How do I add EU CAPTCHA to a Next.js application?
Install the package with npm i @myrasec/eu-captcha. Create a Client Component marked with 'use client', import { EuCaptcha, isEuCaptchaDone } from '@myrasec/eu-captcha', and place <EuCaptcha sitekey={sitekey} /> inside your form. Call isEuCaptchaDone() on submit and pass the eu-captcha-response token to a Server Action or API Route Handler for server-side validation.
Does EU CAPTCHA work with the Next.js App Router?
Yes. In the App Router, place the EuCaptcha component inside a Client Component marked with the 'use client' directive, as the widget requires browser APIs. Token verification happens in a Server Action or Route Handler which runs on the server, keeping your secret key safe.
Can I use EU CAPTCHA with Next.js Server Actions?
Yes. Server Actions are the recommended pattern for App Router forms. Your Client Component form captures the eu-captcha-response token and passes it as a hidden input or form data field to the Server Action. The Server Action then calls the EU CAPTCHA verification API with your secret key before processing the rest of the form data.
Is EU CAPTCHA compatible with the Next.js Pages Router?
Yes. In the Pages Router, use the EuCaptcha component from @myrasec/eu-captcha inside your form. The token is sent to a Next.js API route (pages/api/) where you call the EU CAPTCHA verification endpoint with your secret key before processing the submitted data.
How do I avoid hydration errors when using EU CAPTCHA in Next.js?
Since the EuCaptcha component from @myrasec/eu-captcha requires browser APIs, always place it inside a Client Component ('use client'). In the Pages Router, you can also use dynamic import with ssr: false to prevent any server-side rendering of the widget and avoid hydration mismatches.
How do I validate the CAPTCHA token in a Next.js Route Handler?
In your Route Handler (app/api/route.ts), extract the eu-captcha-response value from the request body. Make a POST request to the EU CAPTCHA verification API with your secret key and the token. If the API returns a successful response, proceed to process the form data. Otherwise, return a 400 or 422 error to the client.
Is EU CAPTCHA GDPR compliant for Next.js applications?
Yes. EU CAPTCHA is operated by an EU-based company, is hosted entirely in Germany, and does not rely on US cloud providers or infrastructure subject to US surveillance laws. The service processes only the data necessary to provide and verify the CAPTCHA (such as IP address and technical browser or device information) in line with the requirements of the GDPR. Your organization remains responsible for providing transparent privacy information, selecting an appropriate legal basis, and obtaining any required consent for your specific Next.js implementation. This information does not constitute legal advice; please consult your legal counsel for an assessment of your individual case.
Ready for a better CAPTCHA?
Experience invisible bot protection with privacy‑first, GDPR‑compliant verification made and hosted in Germany. Try Myra EU CAPTCHA now 3 months for free and secure your web forms without adding friction for your users.
Privacy-first technology
We guarantee zero data transfer to third-country jurisdictions.
Read our privacy policyFast and easy setup
We offer ready-made integrations for many CMS and popular frameworks.
Read our quick start guide