Skip to content

Commit 0328ff5

Browse files
CodeepCodeep
Codeep
authored and
Codeep
committedMay 24, 2018
Update README.md, use optional props and visible recaptcha
1 parent 5e8f9a2 commit 0328ff5

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed
 

‎README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
This component is created in order to make the experience of integrating Google ReCaptcha into React apps easier and smoother.
44

5-
P.S. It will open the ReCaptcha window only when there are some doubts by Google; otherwise, it will automatically generate the token.
5+
Currently, we are using ReCaptcha V2 here. ReCaptcha V3 is still in beta version; so, we will update our component when they release the stable version.
6+
7+
P.S. It will open the ReCaptcha window only when there are some doubts by Google; otherwise, it will automatically generate the recaptcha token.
68

79
## Installation
810

@@ -28,6 +30,11 @@ componentDidMount() {
2830

2931

3032
### 2. Use `ReCaptcha` to integrate ReCaptcha in a particular component
33+
34+
#### invisible Recaptcha
35+
36+
Create a new component with the following code and give it a try!
37+
3138
```
3239
import React, { Component } from 'react';
3340
import { ReCaptcha } from 'react-recaptcha-google'
@@ -83,3 +90,17 @@ class ExampleComponent extends Component {
8390
export default ExampleComponent;
8491
8592
```
93+
94+
95+
#### Visible / Normal Recaptcha
96+
97+
For having a visible ReCaptcha, you should make two minor changes on the above-mentioned code.
98+
1. Replace the size prop value `invisible` (see the imported ReCaptcha component) with either `normal` or `compact`. Those will add a checkbox with 'I am not a robot' label.
99+
2. Remove `this.[captchaRef].execute()` lines from your code.
100+
101+
102+
103+
##### Optional props
104+
105+
* `data-theme` - you can add `theme` prop with a value of either `"dark"` or `"light"`(default) to control the background theme of the visible ReCaptcha (when size is `normal` or `compact`)
106+
* `data-badge` - you can send `badge` prop with one of the following values: bottomright (default), bottomleft, inline. This will allowyou to reposition the ReCaptcha badge.

‎package.json

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{
22
"name": "react-recaptcha-google",
33
"version": "1.0.8",
4-
"description": "",
4+
"description": "This library helps to integrate google recaptcha into your react project easily. ",
5+
"keywords": [
6+
"react",
7+
"react.js",
8+
"react-component",
9+
"ReCaptcha",
10+
"g-recaptcha",
11+
"invisible-recaptcha",
12+
"visible-recaptcha",
13+
"recaptcha-token"
14+
],
515
"main": "dist/index.js",
616
"scripts": {
717
"start": "webpack --watch",
@@ -11,7 +21,7 @@
1121
"type": "git",
1222
"url": "git+https://github.com/codeep/react-recaptcha-google.git"
1323
},
14-
"author": "",
24+
"author": "Codeep",
1525
"license": "MIT",
1626
"bugs": {
1727
"url": "https://github.com/codeep/react-recaptcha-google/issues"

0 commit comments

Comments
 (0)