Frontend

EU CAPTCHA for Gatsby

Gatsby is a React-based open-source framework for building fast static websites and web applications with a modern JAMstack architecture. Protect your Gatsby site from bots and form spam with a privacy-first, EU-hosted CAPTCHA that fits naturally into React components.

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. 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 Account
  2. 2. Create a sitekey for your domain

    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 Gatsby site to your EU CAPTCHA account.

  3. 3. Integrate EU CAPTCHA into your Gatsby site

    Install the package by running npm i @myrasec/eu-captcha, then share the integration guide with your developer. Guard any DOM access with typeof window !== 'undefined' to prevent build-time errors.

    View integration guide
  4. 4. Verify the token server-side

    To finish the integration, validate the eu-captcha-response token in a Gatsby Function (src/api/) or external backend before processing submissions.

    View server-side guide

5. The EU CAPTCHA widget will appear on your Gatsby site.

Verified

Frequently Asked Questions

  • How do I add EU CAPTCHA to a Gatsby site?

    Install the package with npm i @myrasec/eu-captcha. Import { EuCaptcha, isEuCaptchaDone } from '@myrasec/eu-captcha' and place <EuCaptcha sitekey={sitekey} /> in your form component. Guard any DOM access with typeof window !== 'undefined'. Call isEuCaptchaDone() on submit and send the token to a Gatsby Function or backend API for server-side verification.

  • Does EU CAPTCHA work with Gatsby's static site generation?

    Yes. Since the EuCaptcha component only runs in the browser after hydration, it works seamlessly with Gatsby's SSG approach. The component does not render during the static build — it initialises after the page hydrates in the user's browser, which is exactly when form interactions occur.

  • How do I prevent build-time errors with EU CAPTCHA in Gatsby?

    Gatsby builds pages at compile time using Node.js, where window and document are not available. The @myrasec/eu-captcha package handles this gracefully, but if you access the widget element directly, always guard DOM queries with a typeof window !== 'undefined' check or place them inside a useEffect hook.

  • Can I verify the CAPTCHA token using Gatsby Functions?

    Yes. Gatsby Functions (placed in src/api/) provide serverless endpoints that run on Netlify or other compatible hosts. Create a function that receives the eu-captcha-response token, POSTs it to the EU CAPTCHA verification API with your secret key, and returns an appropriate response to the client before processing the form data.

  • Does EU CAPTCHA work alongside Formik or React Hook Form?

    Yes. The EuCaptcha component from @myrasec/eu-captcha works independently of any form library. Place it inside your form, use isEuCaptchaDone() to confirm completion, and read the hidden eu-captcha-response input value in your submission handler. Include it alongside the rest of your form data before sending to the server.

  • How should I handle CAPTCHA reinitialisation in Gatsby client-side navigation?

    The EuCaptcha component follows standard React lifecycle rules and reinitialises each time it mounts. When Gatsby navigates between pages, components unmount and remount, so the widget reinitialises automatically. Use a key prop tied to the current location pathname if you need to force a full reinitialisation.

  • Is EU CAPTCHA GDPR compliant for Gatsby sites?

    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 Gatsby 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 policy

Fast and easy setup

We offer ready-made integrations for many CMS and popular frameworks.

Read our quick start guide