
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
captcha-kit
Advanced tools
Advanced front-end captcha library with graphic, slider, puzzle, invisible modes
A powerful and easy-to-use front-end captcha library that supports multiple captcha types, including graphic captcha, slider captcha, and puzzle captcha.
npm install smart-captcha
import { createCaptcha } from 'smart-captcha';
Create a graphic captcha instance, supporting custom character length, interference lines, interference points, etc. Verify user input by calling the verify() method, and refresh the captcha using the refresh() method.
Create a slider captcha instance, where users complete verification by sliding the slider. Supports custom slider styles, track colors, and hint text.
Create a puzzle captcha instance, where users need to drag the slider to move the puzzle piece to the correct position. Supports custom background images, puzzle shapes, and sizes.
Factory function to create captcha instances.
| Parameter | Type | Description |
|---|---|---|
| options | CaptchaOptions | Captcha configuration options |
Captcha instance.
Unified interface for captcha configuration options, specific options vary depending on mode.
| Event | Type | Description |
|---|---|---|
| onSuccess | Function | Verification success callback |
| onFail | Function | Verification failure callback |
| onRefresh | Function | Captcha refresh callback |
| onTimeout | Function | Captcha timeout callback |
| Option | Type | Default | Description |
|---|---|---|---|
| container | HTMLElement | - | Captcha container element |
| length | number | 4 | Captcha character length |
| lineCount | number | 6 | Number of interference lines |
| dotCount | number | 20 | Number of interference points |
| fontSize | number | 20 | Font size |
| chars | string | 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789' | Optional character set |
| strictCase | boolean | false | Whether to strictly check case |
| refreshOnFail | boolean | false | Whether to refresh when verification fails |
| fonts | string[] | - | Optional font list |
| timeout | number | 60000 | Captcha expiration time (milliseconds) |
| Option | Type | Default | Description |
|---|---|---|---|
| container | HTMLElement | - | Captcha container element |
| threshold | number | 0.95 | Success threshold (percentage) |
| resetOnFail | boolean | true | Whether to reset after verification failure |
| timeout | number | 60000 | Timeout time (milliseconds) |
| sliderColor | string | '#409eff' | Slider color |
| trackColor | string | '#f5f7fa' | Track color |
| textColor | string | '#606266' | Text color |
| hintText | string | 'Slide to the right to complete verification' | Default hint text |
| successColor | string | '#67c23a' | Success color |
| failColor | string | '#f35445' | Failure color |
| successText | string | 'Verification passed' | Success text |
| failText | string | 'Verification failed, please try again' | Failure text |
| Option | Type | Default | Description |
|---|---|---|---|
| container | HTMLElement | - | Captcha container element |
| width | number | 300 | Container width |
| height | number | 200 | Container height |
| puzzleWidth | number | 50 | Puzzle block width |
| puzzleHeight | number | 50 | Puzzle block height |
| backgroundImage | string | string[] | - |
| shape | 'triangle' | 'square' | 'hexagon' |
| threshold | number | 5 | Success threshold |
| resetOnFail | boolean | true | Whether to reset after failure |
| showAsPopup | boolean | false | Whether to show as popup |
| textColor | string | '#606266' | Text color |
| successColor | string | '#67c23a' | Success color |
| sliderColor | string | '#409eff' | Slider initial color |
| mismatchColor | string | '#f35248' | Slider mismatch color |
| hintText | string | 'Drag the slider to complete the puzzle' | Default hint text |
| failText | string | 'Verification failed, please try again' | Failure text |
| successText | string | 'Verification passed' | Success text |
| Method | Description |
|---|---|
| verify(input: string | number): Promise |
| refresh(): Promise | Refresh captcha |
| destroy(): void | Destroy captcha instance |
| Method | Description |
|---|---|
| refresh(): void | Refresh captcha |
| destroy(): void | Destroy captcha instance |
| getVerified(): boolean | Get verification status |
| Method | Description |
|---|---|
| refresh(): void | Refresh captcha |
| destroy(): void | Destroy captcha instance |
npm install
npm run build
npm start
This will open the test page in the browser, showing usage examples of various captchas.
Check the example files in the test directory:
graphic.html - Graphic captcha exampleslider.html - Slider captcha examplepuzzle.html - Puzzle captcha exampleMIT License
Welcome to submit Issues and Pull Requests!
FAQs
Advanced front-end captcha library with graphic, slider, puzzle, invisible modes
The npm package captcha-kit receives a total of 2 weekly downloads. As such, captcha-kit popularity was classified as not popular.
We found that captcha-kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.