A powerful and highly customizable CAPTCHA generator for Node.js applications, built on top of the fast skia-canvas
rendering engine.
const { createCaptchaSync, CaptchaGenerator } = require("captcha-canvas");
// Simple generation
const { image, text } = createCaptchaSync(300, 100);
// Advanced generation with fluent API
const captcha = new CaptchaGenerator()
.setDimension(150, 400)
.setCaptcha({ characters: 6, size: 60 })
.setTrace({ color: "#ff0000" });
const buffer = captcha.generateSync();
# Install peer dependency first
npm install skia-canvas
# Install captcha-canvas
npm install captcha-canvas
For detailed usage examples, integration patterns, and troubleshooting, see the complete documentation sections below.