Skip to content

otplib API Documentation / @otplib/hotp / HOTPVerifyOptions

Type Alias: HOTPVerifyOptions

HOTPVerifyOptions = HOTPGenerateOptions & object

Defined in: hotp/src/types.ts:64

Required options for HOTP verification

Requires secret, counter, token, and crypto for verification.

Type Declaration

counterTolerance?

readonly optional counterTolerance: number | number[]

Counter tolerance for verification (default: 0)

  • Number: symmetric look-ahead window [counter, counter + counterTolerance]
  • Array: asymmetric window, where positive values are look-ahead and negative values are look-back Examples: [0, 1] allows counter and counter+1; [-1, 0, 1] allows counter-1, counter, counter+1

token

readonly token: string

The OTP token to verify

Released under the MIT License.