next-recaptcha-v3 1.2.0 → 1.4.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/lib/ReCaptcha.js +1 -1
- package/lib/ReCaptchaProvider.js +1 -1
- package/lib/useReCaptcha.js +4 -1
- package/lib/utils.d.ts +2 -2
- package/lib/utils.js +1 -1
- package/lib/withReCaptcha.js +1 -1
- package/package.json +20 -20
package/lib/ReCaptcha.js
CHANGED
package/lib/ReCaptchaProvider.js
CHANGED
package/lib/useReCaptcha.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { useRef, useCallback } from 'react';
|
|
3
3
|
import { useReCaptchaContext } from './ReCaptchaProvider.js';
|
|
4
4
|
import { useIsomorphicLayoutEffect } from './utils.js';
|
|
@@ -19,6 +19,9 @@ const useReCaptcha = (reCaptchaKey) => {
|
|
|
19
19
|
if (typeof executeCaptchaRef.current !== "function") {
|
|
20
20
|
throw new Error("Recaptcha has not been loaded");
|
|
21
21
|
}
|
|
22
|
+
if (!siteKey) {
|
|
23
|
+
throw new Error("ReCaptcha sitekey is not defined");
|
|
24
|
+
}
|
|
22
25
|
const result = await executeCaptchaRef.current(siteKey, { action });
|
|
23
26
|
return result;
|
|
24
27
|
}, [siteKey]);
|
package/lib/utils.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { useLayoutEffect } from "react";
|
|
|
4
4
|
* Refs: https://developers.google.com/recaptcha/docs/loading
|
|
5
5
|
*/
|
|
6
6
|
export declare const getRecaptchaScriptSrc: ({ reCaptchaKey, language, useRecaptchaNet, useEnterprise, }?: {
|
|
7
|
-
reCaptchaKey?: string;
|
|
8
|
-
language?: string;
|
|
7
|
+
reCaptchaKey?: string | null;
|
|
8
|
+
language?: string | null;
|
|
9
9
|
useRecaptchaNet?: boolean;
|
|
10
10
|
useEnterprise?: boolean;
|
|
11
11
|
}) => string;
|
package/lib/utils.js
CHANGED
package/lib/withReCaptcha.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-recaptcha-v3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "🤖 Next.js hook to add Google ReCaptcha to your application",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roman Zhuravlov",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prepublishOnly": "npm run rollup"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"next": "
|
|
34
|
+
"next": "^13.0.0 || ^14.0.0",
|
|
35
35
|
"react": ">=18.0.0",
|
|
36
36
|
"react-dom": ">=18.0.0"
|
|
37
37
|
},
|
|
@@ -44,27 +44,27 @@
|
|
|
44
44
|
"node": ">=18.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
48
|
-
"@rollup/plugin-typescript": "^11.1.
|
|
49
|
-
"@types/node": "^20.
|
|
50
|
-
"@types/react": "^18.2.
|
|
51
|
-
"@types/react-dom": "^18.2.
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
53
|
-
"@typescript-eslint/parser": "^
|
|
54
|
-
"eslint": "^8.
|
|
55
|
-
"eslint-config-next": "^
|
|
56
|
-
"eslint-config-prettier": "^
|
|
47
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
48
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
49
|
+
"@types/node": "^20.11.6",
|
|
50
|
+
"@types/react": "^18.2.48",
|
|
51
|
+
"@types/react-dom": "^18.2.18",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
|
53
|
+
"@typescript-eslint/parser": "^6.19.1",
|
|
54
|
+
"eslint": "^8.56.0",
|
|
55
|
+
"eslint-config-next": "^14.1.0",
|
|
56
|
+
"eslint-config-prettier": "^9.1.0",
|
|
57
57
|
"husky": "^8.0.3",
|
|
58
|
-
"lint-staged": "^
|
|
59
|
-
"next": "^
|
|
60
|
-
"prettier": "
|
|
61
|
-
"pretty-quick": "^
|
|
58
|
+
"lint-staged": "^15.2.0",
|
|
59
|
+
"next": "^14.1.0",
|
|
60
|
+
"prettier": "4.0.0-alpha.8",
|
|
61
|
+
"pretty-quick": "^4.0.0",
|
|
62
62
|
"react": "^18.2.0",
|
|
63
63
|
"react-dom": "^18.2.0",
|
|
64
|
-
"rollup": "^
|
|
65
|
-
"rollup-plugin-node-externals": "^6.1.
|
|
66
|
-
"rollup-plugin-preserve-directives": "^0.
|
|
67
|
-
"typescript": "^5.
|
|
64
|
+
"rollup": "^4.9.6",
|
|
65
|
+
"rollup-plugin-node-externals": "^6.1.2",
|
|
66
|
+
"rollup-plugin-preserve-directives": "^0.3.1",
|
|
67
|
+
"typescript": "^5.3.3"
|
|
68
68
|
},
|
|
69
69
|
"lint-staged": {
|
|
70
70
|
"**/*.{js,jsx,ts,tsx}": [
|