Configure ReCaptchaProvider
masterTo use ReCaptcha, wrap your application with ReCaptchaProvider. This component uses next/script to load the ReCaptcha script into your document.
You can provide your site key in two ways:
- Set the
NEXT_PUBLIC_RECAPTCHA_SITE_KEYenvironment variable. - Pass the
reCaptchaKeyprop directly toReCaptchaProvider.
import { ReCaptchaProvider } from "next-recaptcha-v3";
const MyApp = ({ Component, pageProps }) => (
<ReCaptchaProvider reCaptchaKey="[GTM-XXXXXXX]">
<Component {...pageProps} />
</ReCaptchaProvider>
);