Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@captchafox/react

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@captchafox/react - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

1

dist/index.d.ts

@@ -9,2 +9,3 @@ import { WidgetApi, WidgetOptions } from '@captchafox/types';

className?: string | undefined;
nonce?: string | undefined;
} & React.RefAttributes<CaptchaFoxInstance>>;

@@ -11,0 +12,0 @@

9

dist/index.js

@@ -33,3 +33,3 @@ "use client";

function loadCaptchaScript() {
return __async(this, null, function* () {
return __async(this, arguments, function* ({ nonce } = {}) {
if (document.querySelector(`script[src="${SCRIPT_SRC}"]`))

@@ -43,2 +43,5 @@ return mountInstance;

script.onerror = rejectFn;
if (nonce) {
script.nonce = nonce;
}
document.body.appendChild(script);

@@ -53,3 +56,3 @@ return mountInstance;

var CaptchaFox = forwardRef(
({ sitekey, lang, mode, theme, className, onError, onVerify, onLoad, onFail, onClose }, ref) => {
({ sitekey, lang, mode, theme, className, nonce, onError, onVerify, onLoad, onFail, onClose }, ref) => {
const [containerRef, setContainerRef] = useState();

@@ -120,3 +123,3 @@ const [widgetId, setWidgetId] = useState();

} else {
loadCaptchaScript().then(() => __async(void 0, null, function* () {
loadCaptchaScript({ nonce }).then(() => __async(void 0, null, function* () {
if (isApiReady()) {

@@ -123,0 +126,0 @@ firstRendered.current = true;

{
"name": "@captchafox/react",
"version": "1.3.1",
"version": "1.4.0",
"main": "./dist/index.cjs",

@@ -5,0 +5,0 @@ "module": "./dist/index.js",

@@ -37,13 +37,14 @@ # @captchafox/react

| **Prop** | **Type** | **Description** | **Required** |
| -------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------ |
| sitekey | `string` | The sitekey for the widget | ✅ |
| lang | `string` | The language the widget should display. Defaults to automatically detecting it. | |
| mode | `inline\|popup\|hidden` | The mode the widget should be displayed in . | |
| theme | `light` \| `dark` \| [`ThemeDefinition`](https://docs.captchafox.com/theming#custom-theme) | The theme of the widget. Defaults to light. |
| onVerify | `function` | Called with the response token after successful verification. | |
| onFail | `function` | Called after unsuccessful verification. | |
| onError | `function` | Called when an error occured. | |
| onExpire | `function` | Called when the challenge expires. | |
| onClose | `function` | Called when the challenge was closed. | |
| **Prop** | **Type** | **Description** | **Required** |
| -------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------ |
| sitekey | `string` | The sitekey for the widget | ✅ |
| lang | `string` | The language the widget should display. Defaults to automatically detecting it. | |
| mode | `inline\|popup\|hidden` | The mode the widget should be displayed in . | |
| theme | `light` &#124; `dark` &#124; [`ThemeDefinition`](https://docs.captchafox.com/theming#custom-theme) | The theme of the widget. Defaults to light. | |
| nonce | `string` | Randomly generated nonce | |
| onVerify | `function` | Called with the response token after successful verification. | |
| onFail | `function` | Called after unsuccessful verification. | |
| onError | `function` | Called when an error occured. | |
| onExpire | `function` | Called when the challenge expires. | |
| onClose | `function` | Called when the challenge was closed. | |

@@ -50,0 +51,0 @@ ### Using the verification callback

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc