Captcha Canvas Challenge
Captcha Canvas Challenge is a standalone image captcha generator. It renders randomized text onto an HTML canvas and returns the resulting image, which communities can present to authors as a spam challenge.
Source code: github.com/bitsocialnet/captcha-canvas-challenge
Requirements
- Node.js >= 22
- ESM-only -- this package does not ship CommonJS builds.
Installation
npm install @bitsocial/captcha-canvas-challenge
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
characters | number | 6 | Number of random characters rendered in the captcha image. |
height | number | 100 | Height of the generated image in pixels. |
width | number | 300 | Width of the generated image in pixels. |
colors | string | #32cf7e | Primary color used for the captcha text. |
How It Works
- The generator picks a random string of the configured length.
- The string is rendered onto a canvas with visual noise to resist OCR.
- The resulting image (and the expected answer) are returned so the calling application can present the challenge and later verify the response.
Because the package is a pure image generator, it does not handle networking or session management on its own. It is intended to be integrated into a larger challenge flow -- for example, as one of the challenge types supported by Spam Blocker.