next-recaptcha-v3 1.4.0 → 1.5.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 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
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface ReCaptchaProps {
3
2
  onValidate: (token: string) => void;
4
3
  action: string;
@@ -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,74 @@
1
- {
2
- "name": "next-recaptcha-v3",
3
- "version": "1.4.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.0.0 || ^14.0.0",
35
- "react": ">=18.0.0",
36
- "react-dom": ">=18.0.0"
37
- },
38
- "peerDependenciesMeta": {
39
- "react-dom": {
40
- "optional": true
41
- }
42
- },
43
- "engines": {
44
- "node": ">=18.0.0"
45
- },
46
- "devDependencies": {
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
- "husky": "^8.0.3",
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
- "react": "^18.2.0",
63
- "react-dom": "^18.2.0",
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
- },
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.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.0.0 || ^14.0.0 || ^15.0.0",
35
+ "react": ">=18.0.0",
36
+ "react-dom": ">=18.0.0"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "react-dom": {
40
+ "optional": true
41
+ }
42
+ },
43
+ "engines": {
44
+ "node": ">=18.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@rollup/plugin-node-resolve": "^15.3.0",
48
+ "@rollup/plugin-typescript": "^12.1.1",
49
+ "@types/node": "^22.8.1",
50
+ "@types/react": "^18.3.12",
51
+ "@types/react-dom": "^18.3.1",
52
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
53
+ "@typescript-eslint/parser": "^7.18.0",
54
+ "eslint": "^8.57.1",
55
+ "eslint-config-next": "^15.0.1",
56
+ "eslint-config-prettier": "^9.1.0",
57
+ "husky": "^9.1.6",
58
+ "lint-staged": "^15.2.10",
59
+ "next": "^15.0.1",
60
+ "prettier": "4.0.0-alpha.8",
61
+ "pretty-quick": "^4.0.0",
62
+ "react": "^18.3.1",
63
+ "react-dom": "^18.3.1",
64
+ "rollup": "^4.24.0",
65
+ "rollup-plugin-node-externals": "^7.1.3",
66
+ "rollup-plugin-preserve-directives": "^0.4.0",
67
+ "typescript": "^5.6.3"
68
+ },
69
+ "lint-staged": {
70
+ "**/*.{js,jsx,ts,tsx}": [
71
+ "pretty-quick --staged"
72
+ ]
73
+ }
74
+ }