diff --git a/README.md b/README.md index 25acd0b..e81c672 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ In these instances, you'll most likely want to use `ref` to handle the callbacks |`imghost`|String|No|`-`|See enterprise docs.| |`reportapi`|String|No|`-`|See enterprise docs.| |`sentry`|String|No|`-`|See enterprise docs.| +|`custom`|Boolean|No|`-`|See enterprise docs.| ### Events diff --git a/package-lock.json b/package-lock.json index 9cc635a..af5250b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@hcaptcha/react-hcaptcha", - "version": "0.3.6", + "version": "0.3.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8abc89a..82810ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hcaptcha/react-hcaptcha", - "version": "0.3.6", + "version": "0.3.7", "types": "types/index.d.ts", "main": "dist/index.js", "files": [ diff --git a/src/index.js b/src/index.js index 32ea801..1642b82 100644 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,7 @@ class HCaptcha extends React.Component { } componentDidMount () { //Once captcha is mounted intialize hCaptcha - hCaptcha - const { apihost, assethost, endpoint, host, imghost, languageOverride:hl, reCaptchaCompat, reportapi, sentry } = this.props; + const { apihost, assethost, endpoint, host, imghost, languageOverride:hl, reCaptchaCompat, reportapi, sentry, custom } = this.props; const { isApiReady } = this.state; if (!isApiReady) { //Check if hCaptcha has already been loaded, if not create script tag and wait to render captcha @@ -75,7 +75,8 @@ class HCaptcha extends React.Component { imghost, recaptchacompat: reCaptchaCompat === false? "off" : null, reportapi, - sentry + sentry, + custom }); } diff --git a/tests/hcaptcha.spec.js b/tests/hcaptcha.spec.js index e7187e9..d88de89 100644 --- a/tests/hcaptcha.spec.js +++ b/tests/hcaptcha.spec.js @@ -284,6 +284,16 @@ describe("hCaptcha", () => { const scripts = document.querySelectorAll("head > script"); expect(scripts.length).toBe(1); - }) + }); + + it("custom parameter should be in script query", () => { + instance = ReactTestUtils.renderIntoDocument(); + + const script = document.querySelector("head > script"); + expect(script.src).toContain("custom=true"); + }); }); });