Skip to content

Specifying timeouts

Custom timeouts can be specified for the length of time in which a user has to solve the CAPTCHA challenge. The defaults are as follows:

TimeoutCAPTCHA TypeDescriptionDefault
challengeTimeoutImageThe timeframe in which a user must complete a CAPTCHA challenge1 minute
solutionTimeoutImageThe timeframe in which a CAPTCHA solution remains valid on the page before timing out2 minutes
verifiedTimeoutImageThe timeframe in which a CAPTCHA solution must be verified server side3 minutes
cachedTimeoutImageThe time in milliseconds that a cached, verified, CAPTCHA solution is valid for15 minutes
challengeTimeoutPoWThe timeframe in which a PoW CAPTCHA solution remains valid on the page before timing out1 minute
solutionTimeoutPoWThe timeframe in which a PoW CAPTCHA must be completed and verified2 minutes
cachedTimeoutPoWThe time in milliseconds that a Provider cached, verified, PoW CAPTCHA solution is valid for3 minutes

To specify timeouts using API verification, pass the above object in a field called timeouts, implementing one or more of the timeouts.

const defaultCaptchaTimeouts = {
image: {
// The timeframe in which a user must complete an image captcha
challengeTimeout: YOUR_VALUE_HERE,
// ...
},
pow: {
// The timeframe in which a pow captcha solution remains valid on the page before timing out
challengeTimeout: YOUR_VALUE_HERE,
// ...
},
}
// send a POST application/json request to the API endpoint
response = POST('https://api.prosopo.io/siteverify', {
...
timeouts: defaultCaptchaTimeouts, // add timeouts object here
})

To specify timeouts using the verification package, pass the above object in the timeouts field of the ProsopoServer config, implementing one or more of the timeouts.

config = { timeouts: defaultCaptchaTimeouts, ...config }
const prosopoServer = new ProsopoServer(config, pair)