You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@google-recaptcha/react

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-recaptcha/react

Tool that easily and quickly add Google ReCaptcha for your website or application

2.3.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source
React Use logo

React Google reCAPTCHA

NPM version License reactuse Join the community on GitHub

Google reCAPTCHA is a powerful library that provides easy integration of Google reCAPTCHA into your React applications. Built with TypeScript-first approach, SSR compatibility, and tree-shaking optimization - everything you need to protect your forms and applications from spam and abuse.

Supported reCAPTCHA Versions

  • V3 - Invisible protection that returns a risk score (0.0-1.0) for each request
  • V2 Invisible - Background analysis without user interaction
  • V2 Checkbox - Interactive "I'm not a robot" checkbox with optional challenges
  • Enterprise mode - support enterprise

Documentation

Visit https://siberiacancode.github.io/google-recaptcha/docs/react to view the full documentation.

Getting Started

npm install @google-recaptcha/react
import React from "react";
import ReactDOM from "react-dom/client";
import { GoogleReCaptchaProvider } from "@google-recaptcha/react";

import App from "./App";

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <GoogleReCaptchaProvider type="v3" siteKey="your_site_key">
      <App />
    </GoogleReCaptchaProvider>
  </React.StrictMode>
);

Create a component to use reCAPTCHA:

import type { FormEvent } from 'react';
import { useGoogleReCaptcha } from '@google-recaptcha/react';

export const Form = () => {
  const googleReCaptcha = useGoogleReCaptcha();

  const onSubmit = async (event: FormEvent) => {
    event.preventDefault();

    const token = await googleReCaptcha.executeV3('action');
    ...
  };

  return (
    <form onSubmit={onSubmit}>
      ...
      <button type="submit">Submit</button>
    </form>
  );
}

Keywords

google recaptcha

FAQs

Package last updated on 21 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.