ribaunt for use in your server-side code.
ChallengeToken
A signed JWT challenge token. This is the string value returned in the array from createChallenge() and the value you pass back to verifySolution().
ChallengeSolution
The proof-of-work solution produced by the browser solver (or by solveChallenge() in tests). The nonce is the value that, when hashed with the challenge string, produces a SHA-256 digest beginning with the required number of leading zero hex digits.
ReplayStore
The interface you implement to provide distributed replay prevention when replayPrevention is set to 'remote'. You pass your implementation to verifySolution() via options.replayStore.
jti is the JWT token ID uniquely identifying the challenge. expiresAt is a Unix timestamp in seconds indicating when the token expires. Return true to allow the submission (first use) and false to reject it (replay detected). Your implementation must be atomic — use a primitive such as Redis SET NX EXAT to avoid race conditions.
LocalReplayStore
The built-in, process-local implementation of ReplayStore exported from ribaunt. It stores consumed token IDs in memory and automatically evicts entries once their TTL has passed. Use this when replayPrevention is 'local' (the default) — it is used automatically in that mode. You can also instantiate it directly when you need a dedicated per-handler store.
LocalReplayStore is not suitable for multi-process or serverless deployments. For those environments, implement your own ReplayStore backed by a distributed atomic store such as Redis SET NX EXAT.
ReplayPreventionMode
Controls how verifySolution() prevents a token from being submitted more than once.
'local'(default) — replay checks are process-local. Suitable for single-process deployments.'remote'— replay checks use yourReplayStore. Use this for serverless or horizontally scaled deployments.'disabled'— no replay checks. Tokens can be reused until they expire. Only use this if another layer handles replay prevention.
VerifySolutionOptions
Optional configuration passed as the third argument to verifySolution().
VerifyWarning
The structured warning object passed to the onWarning callback when verifySolution() encounters a problem. Allows you to capture telemetry without enabling console output.
VerifyWarningReason
A string union describing the category of verification failure. You can use this to route warnings to different monitoring channels or metrics.
SolveChallengeOptions
Optional guardrails passed to solveChallenge() to prevent it from running indefinitely during tests.
WidgetState
Imported from ribaunt/widget. Represents the current state of the CAPTCHA widget in the browser.
RibauntWidgetHandle
Imported from ribaunt/widget-react. This is the imperative handle exposed via a React ref attached to the <RibauntWidget> component. Use it to programmatically control the widget from your application code.