Install the library with npm install gt4-node-sdk
or yarn add gt4-node-sdk
import { GeeTest } from 'gt4-node-sdk'
const gt = new GeeTest({
captchaId: 'your_id',
captchaKey: 'your_key'
})
const { result, reason } = await gt.validate({
lotNumber: 'your_lot_number',
captchaOutput: 'your_captcha_output',
passToken: 'your_pass_token',
genTime: 'your_gen_time'
})
if (result === 'success') {
console.log('success')
} else {
console.log('fail: %s', reason)
}