Test the CAPTCHA verification API endpoints and see how to integrate them into your application
import { CaptchaClient } from '@/lib/api-client'
// Initialize the client
const captcha = new CaptchaClient({
domain: 'example.com',
type: 'math',
level: 'normal'
})
// Create verification state
const state = await captcha.createState()
// Generate jump URL
const jumpUrl = captcha.generateJumpUrl(window.location.href)
// Redirect to verification
captcha.redirectToVerification()/api/state/createCreate verification state
/api/state/parseParse and validate state
/api/captcha/challengeGenerate CAPTCHA challenge
/api/captcha/verifyVerify CAPTCHA answer
/api/verify/tokenVerify authentication token
/api/jump/initInitialize jump verification
/api/configGet system configuration
/api/statsGet verification statistics
/api/healthHealth check
Create a CaptchaClient instance with your domain configuration
Use the redirectToVerification method to send users to the CAPTCHA page
Check the verification token when users return to your site