solveChallenge() runs the same proof-of-work algorithm used by the browser widget, but synchronously in Node.js. It is designed for automated testing of your challenge and verify endpoints — not for production use in request handlers.
Import
Signature
Parameters
ChallengeToken | ChallengeToken[]
required
A single JWT challenge token or an array of tokens from
createChallenge().SolveChallengeOptions
Optional guardrails to prevent long-running synchronous solves.
Return value
Returns aChallengeSolution ({ nonce: string; hash: string }) for a single token input, or ChallengeSolution[] for an array input. Returns undefined if any guardrail is hit or a token is invalid. When solving an array, undefined is returned as soon as any single token fails — no partial results are returned.