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:
Timeout | CAPTCHA Type | Description | Default |
---|---|---|---|
challengeTimeout | Image | The timeframe in which a user must complete a CAPTCHA challenge | 1 minute |
solutionTimeout | Image | The timeframe in which a CAPTCHA solution remains valid on the page before timing out | 2 minutes |
verifiedTimeout | Image | The timeframe in which a CAPTCHA solution must be verified server side | 3 minutes |
cachedTimeout | Image | The time in milliseconds that a cached, verified, CAPTCHA solution is valid for | 15 minutes |
challengeTimeout | PoW | The timeframe in which a PoW CAPTCHA solution remains valid on the page before timing out | 1 minute |
solutionTimeout | PoW | The timeframe in which a PoW CAPTCHA must be completed and verified | 2 minutes |
cachedTimeout | PoW | The time in milliseconds that a Provider cached, verified, PoW CAPTCHA solution is valid for | 3 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 endpointresponse = 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)