Go to developer

SDKs / typescript / partner-2fa

waitForChallengeApproval()

SERVERmethod@keyra/typescript-sdk

Polls until approved with verificationToken, or denied/expired/timeout. Returns the poll result including the one-shot token.

Signature

TypeScript
await partner.waitForChallengeApproval(challengeId, { timeoutMs?, intervalMs? })

Type signature

TypeScript
async waitForChallengeApproval(challengeId: string, opts?: WaitChallengeOptions): Promise<ChallengePollResult>

Parameters

ParameterTypeRequiredDescription
challengeIdstringRequired
optsWaitChallengeOptionsOptionalDefault: {}

Returns

Promise<ChallengePollResult>

SDK behavior

  • Polls until status === approved && verificationToken present.
  • Respects pollAfterMs from the API when provided.
  • Default timeout 120000ms.

Errors

Underlying API