next-recaptcha-v3 1.4.1 → 1.5.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/ReCaptcha.d.ts +0 -1
- package/lib/recaptcha.types.d.ts +10 -0
- package/package.json +68 -74
package/README.md
CHANGED
|
@@ -121,7 +121,7 @@ Use `executeRecaptcha` function returned from the `useReCaptcha` hook to generat
|
|
|
121
121
|
> 🛈 Note: Actions might contain only alphanumeric characters, slashes, and underscores. Actions must not be user-specific.
|
|
122
122
|
|
|
123
123
|
```tsx
|
|
124
|
-
import { useState } from "react";
|
|
124
|
+
import { useState, useCallback } from "react";
|
|
125
125
|
import { useReCaptcha } from "next-recaptcha-v3";
|
|
126
126
|
|
|
127
127
|
const MyForm = () => {
|
|
@@ -163,7 +163,7 @@ const MyForm = () => {
|
|
|
163
163
|
Alternatively, you can also generate token by using `ReCaptcha` component.
|
|
164
164
|
|
|
165
165
|
```tsx
|
|
166
|
-
import { useEffect } from "react";
|
|
166
|
+
import { useEffect, useState } from "react";
|
|
167
167
|
import { ReCaptcha } from "next-recaptcha-v3";
|
|
168
168
|
import { validateToken } from "./utils";
|
|
169
169
|
|
|
@@ -189,7 +189,7 @@ const MyPage = () => {
|
|
|
189
189
|
3. `withReCaptcha` HOC
|
|
190
190
|
|
|
191
191
|
```tsx
|
|
192
|
-
import { useEffect } from "react";
|
|
192
|
+
import { useEffect, useState } from "react";
|
|
193
193
|
import { withReCaptcha, WithReCaptchaProps } from "next-recaptcha-v3";
|
|
194
194
|
import { validateToken } from "./utils";
|
|
195
195
|
|
package/lib/ReCaptcha.d.ts
CHANGED
package/lib/recaptcha.types.d.ts
CHANGED
|
@@ -25,6 +25,11 @@ export interface Parameters {
|
|
|
25
25
|
* @default "image"
|
|
26
26
|
*/
|
|
27
27
|
type?: Type | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Optional. Forces the widget to render in a specific language.
|
|
30
|
+
* Auto-detects the user's language if unspecified.
|
|
31
|
+
*/
|
|
32
|
+
hl?: string | undefined;
|
|
28
33
|
/**
|
|
29
34
|
* Optional. The size of the widget.
|
|
30
35
|
* Accepted values: "compact", "normal", "invisible".
|
|
@@ -42,6 +47,11 @@ export interface Parameters {
|
|
|
42
47
|
* @default "bottomright"
|
|
43
48
|
*/
|
|
44
49
|
badge?: Badge | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Optional. Enterprise checkbox reCAPTCHA only.
|
|
52
|
+
* The action associated with the user-initiated event.
|
|
53
|
+
*/
|
|
54
|
+
action?: string | undefined;
|
|
45
55
|
/**
|
|
46
56
|
* Optional. Invisible reCAPTCHA only. For plugin owners to not interfere with existing reCAPTCHA installations on a page.
|
|
47
57
|
* If true, this reCAPTCHA instance will be part of a separate ID space.
|
package/package.json
CHANGED
|
@@ -1,74 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next-recaptcha-v3",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "🤖 Next.js hook to add Google ReCaptcha to your application",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Roman Zhuravlov",
|
|
7
|
-
"repository": "https://github.com/snelsi/next-recaptcha-v3",
|
|
8
|
-
"homepage": "https://github.com/snelsi/next-recaptcha-v3",
|
|
9
|
-
"keywords": [
|
|
10
|
-
"recaptcha",
|
|
11
|
-
"recaptcha-v3",
|
|
12
|
-
"google-recaptcha-v3",
|
|
13
|
-
"next",
|
|
14
|
-
"next.js",
|
|
15
|
-
"react",
|
|
16
|
-
"hook"
|
|
17
|
-
],
|
|
18
|
-
"type": "module",
|
|
19
|
-
"exports": "./lib/index.js",
|
|
20
|
-
"types": "./lib/index.d.ts",
|
|
21
|
-
"files": [
|
|
22
|
-
"lib"
|
|
23
|
-
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"rollup": "rollup -c",
|
|
26
|
-
"prettier": "prettier --write .",
|
|
27
|
-
"lint": "eslint",
|
|
28
|
-
"lint-fix": "eslint --fix",
|
|
29
|
-
"fix": "npm run prettier && npm run lint-fix",
|
|
30
|
-
"pre-commit": "npm run lint && lint-staged",
|
|
31
|
-
"prepublishOnly": "npm run rollup"
|
|
32
|
-
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"next": "^13
|
|
35
|
-
"react": "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"@
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"lint-staged": {
|
|
70
|
-
"**/*.{js,jsx,ts,tsx}": [
|
|
71
|
-
"pretty-quick --staged"
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "next-recaptcha-v3",
|
|
3
|
+
"version": "1.5.1-canary.0",
|
|
4
|
+
"description": "🤖 Next.js hook to add Google ReCaptcha to your application",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Roman Zhuravlov",
|
|
7
|
+
"repository": "https://github.com/snelsi/next-recaptcha-v3",
|
|
8
|
+
"homepage": "https://github.com/snelsi/next-recaptcha-v3",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"recaptcha",
|
|
11
|
+
"recaptcha-v3",
|
|
12
|
+
"google-recaptcha-v3",
|
|
13
|
+
"next",
|
|
14
|
+
"next.js",
|
|
15
|
+
"react",
|
|
16
|
+
"hook"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"exports": "./lib/index.js",
|
|
20
|
+
"types": "./lib/index.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"lib"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"rollup": "rollup -c",
|
|
26
|
+
"prettier": "prettier --write .",
|
|
27
|
+
"lint": "eslint",
|
|
28
|
+
"lint-fix": "eslint --fix",
|
|
29
|
+
"fix": "npm run prettier && npm run lint-fix",
|
|
30
|
+
"pre-commit": "npm run lint && lint-staged",
|
|
31
|
+
"prepublishOnly": "npm run rollup"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"next": "^13 || ^14 || ^15",
|
|
35
|
+
"react": "^18 || ^19"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
42
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
43
|
+
"@types/node": "^22.9.3",
|
|
44
|
+
"@types/react": "^18.3.12",
|
|
45
|
+
"@types/react-dom": "^18.3.1",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
47
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
48
|
+
"eslint": "^8.57.1",
|
|
49
|
+
"eslint-config-next": "^15.0.3",
|
|
50
|
+
"eslint-config-prettier": "^9.1.0",
|
|
51
|
+
"husky": "^9.1.7",
|
|
52
|
+
"lint-staged": "^15.2.10",
|
|
53
|
+
"next": "^15.0.3",
|
|
54
|
+
"prettier": "4.0.0-alpha.8",
|
|
55
|
+
"pretty-quick": "^4.0.0",
|
|
56
|
+
"react": "^18.3.1",
|
|
57
|
+
"react-dom": "^18.3.1",
|
|
58
|
+
"rollup": "^4.27.4",
|
|
59
|
+
"rollup-plugin-node-externals": "^7.1.3",
|
|
60
|
+
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
61
|
+
"typescript": "^5.7.2"
|
|
62
|
+
},
|
|
63
|
+
"lint-staged": {
|
|
64
|
+
"**/*.{js,jsx,ts,tsx}": [
|
|
65
|
+
"pretty-quick --staged"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|