# @captchafox/solid

> [![NPM version](https://img.shields.io/npm/v/@captchafox/solid.svg)](https://www.npmjs.com/package/@captchafox/solid)

Latest version **1.7.0** (published 2026-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @captchafox/solid
pnpm add @captchafox/solid
yarn add @captchafox/solid
bun add @captchafox/solid
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.7.0 |
| Published | 2026-06-30 |
| First published | 2023-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 8 |
| Maintainers | tgrassl, captchafox-npm |
| Keywords | solid, captchafox |

## Links

- npm: https://www.npmjs.com/package/@captchafox/solid
- Repository: https://github.com/CaptchaFox/javascript-integrations
- Homepage: https://github.com/CaptchaFox/javascript-integrations#readme
- Issues: https://github.com/CaptchaFox/javascript-integrations/issues
- npm.io page: https://npm.io/package/@captchafox/solid

## Dependencies (1)

- [@captchafox/types](https://npm.io/package/@captchafox/types.md) ^1.6.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.7.0 (latest) — 2026-06-30
- 1.6.1 — 2026-06-22
- 1.6.0 — 2026-04-20
- 1.5.0 — 2025-09-04
- 1.4.0 — 2025-02-17
- 1.3.1 — 2024-12-31
- 1.3.0 — 2024-09-12
- 1.2.0 — 2024-06-09
- 1.1.0 — 2024-01-09
- 1.0.0 — 2023-12-03

## README

# @captchafox/solid

[![NPM version](https://img.shields.io/npm/v/@captchafox/solid.svg)](https://www.npmjs.com/package/@captchafox/solid)

## Installation

Install the library using your prefered package manager

```sh
npm install @captchafox/solid
```

```sh
yarn add @captchafox/solid
```

```sh
pnpm add @captchafox/solid
```

```sh
bun add @captchafox/solid
```

## Usage

```tsx
import { CaptchaFox } from '@captchafox/solid';

function Example() {
  return <CaptchaFox sitekey="sk_11111111000000001111111100000000" />;
}
```

### Props

| **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.                                     |              |
| start     | `none\|auto\|focus`                                                                                | Controls when the verification begins. Defaults to `none`.                      |              |
| 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.                                                       |              |
| i18n      | `object`                                                                                           | Custom i18n configuration.                                                      |              |
| hideClose | `boolean`                                                                                          | Hides the close button and prevents users from closing the widget modal.        |              |
| 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.                                           |              |

### Using the verification callback

```jsx
import { CaptchaFox, CAPTCHA_RESPONSE_KEY } from '@captchafox/solid';

function Example() {
  const handleVerify = (token: string) => {
    // do something with the token here (e.g. submit the form)
    const formData = {
      // your form data
      [CAPTCHA_RESPONSE_KEY]: token
    };
  };

  return <CaptchaFox sitekey="sk_11111111000000001111111100000000" onVerify={handleVerify} />;
}
```

### Interacting with the instance

```jsx
import { CaptchaFox, CaptchaFoxInstance } from '@captchafox/solid'

function Example() {
    let captchaRef: CaptchaFoxInstance;

    const triggerAction = async () => {
        // execute the captcha
        try {
            const token = await captchaRef.execute();
        } catch {
            // unsuccessful verification
        }
    }

    return (
        <CaptchaFox
            sitekey="sk_11111111000000001111111100000000"
            ref={captchaRef!}
        />
        <button onClick={triggerAction}>Action</button>
    )
}
```

You can find more detailed examples in the [GitHub repository](https://github.com/CaptchaFox/javascript-integrations/tree/main/examples/solid).

---
_Source: https://npm.io/package/@captchafox/solid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
