From 995bdbdf8d2f774669a949f6d2a60f630286be40 Mon Sep 17 00:00:00 2001 From: debabin Date: Wed, 13 Dec 2023 14:03:10 +0700 Subject: [PATCH] =?UTF-8?q?=E2=98=84=20readme=20callback=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 82 ++++++++++++------------- src/context/GoogleReCaptchaProvider.tsx | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index d2e5720..e9c7212 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ root.render( ### V2 checkbox -When a user interacts with the [Google ReCaptcha v2 checkbox](https://developers.google.com/recaptcha/docs/display), advanced algorithms analyze their behavior to distinguish between humans and bots. If the system suspects suspicious activity, additional challenges may be presented, such as image selections or puzzle-solving tasks. +When a user interacts with the [Google ReCaptcha v2 checkbox](https://developers.google.com/recaptcha/docs/display), advanced algorithms analyze their behavior to distinguish between humans and bots. If the system suspects suspicious activity, additional challenges may be presented, such as image selections or puzzle-solving tasks. ```typescript jsx import { GoogleReCaptchaProvider, GoogleReCaptchaCheckbox } from 'react-google-recaptcha-ultimate'; @@ -93,19 +93,19 @@ root.render( ### Checkbox component -| **Props** | **Type** | **Default** | **Required?** | **Note** | -| --------------- | :---------------------: | ----------: | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -| id | String | | No | Id of component | -| action | String | | No | An action name is used to describe user-initiated events. [More info](https://cloud.google.com/recaptcha-enterprise/docs/actions) | -| className | String | | No | Styles for component | -| container | String or HTMLElement | | No | Container ID where the recaptcha badge will be rendered | -| callback | (token: string) => void | | No | The name of your callback function, executed when the user submits a successful response. The g-recaptcha-response token is passed to your callback. | -| errorCallback | () => void | | No | The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry. | -| expiredCallback | () => void | | No | The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify. | -| language | String | | No | optional prop to support different languages that is supported by Google Recaptcha. [See](https://developers.google.com/recaptcha/docs/language) | -| theme | `dark` or `light` | `light` | No | The color theme of the widget. | -| size | `compact` or `normal` | `normal` | No | The size of the widget. | | -| onChange | (token: string) => void | | No | When called with string (token), it means token retrieved. When called with false as an argument, it means the response expired and the user needs to re-verify. When called with Error, it means an error occurred and the widget cannot continue (usually network disconnection) | | +| **Props** | **Type** | **Default** | **Required?** | **Note** | +|-----------------|:-----------------------:|------------:|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| id | String | | No | Id of component | +| action | String | | No | An action name is used to describe user-initiated events. [More info](https://cloud.google.com/recaptcha-enterprise/docs/actions) | +| className | String | | No | Styles for component | +| container | String or HTMLElement | | No | Container ID where the recaptcha badge will be rendered | +| callback | (token: string) => void | | No | The name of your callback function, executed when the user submits a successful response. The g-recaptcha-response token is passed to your callback. | +| errorCallback | () => void | | No | The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry. | +| expiredCallback | () => void | | No | The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify. | +| language | String | | No | optional prop to support different languages that is supported by Google Recaptcha. [See](https://developers.google.com/recaptcha/docs/language) | +| theme | `dark` or `light` | `light` | No | The color theme of the widget. | +| size | `compact` or `normal` | `normal` | No | The size of the widget. | | +| onChange | (token: string) => void | | No | When called with string (token), it means token retrieved. When called with false as an argument, it means the response expired and the user needs to re-verify. When called with Error, it means an error occurred and the widget cannot continue (usually network disconnection) | | ## Enterprise @@ -135,7 +135,6 @@ root.render( ); ``` - #### v3 or v2 invisible ```typescript jsx @@ -165,12 +164,12 @@ Usually, your application only needs one provider. You should place it as high a Same thing applied when you use this library with framework such as Next.js or React Router and only want to include the script on a single page. Try to make sure you only have one instance of the provider on a React tree and to place it as high (on the tree) as possible. -#### GoogleReCaptchaProvider for v3 and v2-invisible +#### GoogleReCaptchaProvider for v3 and v2-invisible All the props that can be passed in provider for v2-invisible and v3: | **Props** | **Type** | **Default** | **Required** | **Note** | -| ------------------------ | :---------------------------------------------------: | ------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------------|:-----------------------------------------------------:|---------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | type | `v3` or `v2-invisible` | | Yes | Your recaptcha version | | siteKey | String | | Yes | Your recaptcha key, get one from [here](https://www.google.com/recaptcha/admin) | | language | String | | No | Optional prop to support different [languages](https://developers.google.com/recaptcha/docs/language) that is supported by Google Recaptcha | @@ -181,8 +180,8 @@ All the props that can be passed in provider for v2-invisible and v3: | scriptProps | Object | | No | All props used by `