Captcha

Utility functions for captcha generation.

Description:
  • Utility functions for captcha generation.

Source:

Methods

(static) generateSvgCaptcha(options) → {module:Captcha~ReturnGenerateSvgCaptcha}

Description:
  • Generates an SVG captcha with a mathematical expression.

Source:
Example
import { generateSvgCaptcha } from "nsuite";
const { text, data } = await generateSvgCaptcha({
  width: 148,
  height: 48,
});
Parameters:
Name Type Description
options Object

Options for generating the captcha.

Properties
Name Type Attributes Default Description
width number <optional>
150

The width of the captcha image.

height number <optional>
50

The height of the captcha image.

Returns:

An object containing the captcha text and data.

Type
module:Captcha~ReturnGenerateSvgCaptcha

Type Definitions

ReturnGenerateSvgCaptcha

Source:
Properties:
Name Type Description
text string

The text of the mathematical expression.

data string

The SVG data of the captcha image.

Type:
  • Object