otplib API Documentation / otplib / OTPGenerateOptions
Type Alias: OTPGenerateOptions
OTPGenerateOptions =
object
Defined in: otplib/src/class.ts:59
Options for generating a token with the OTP class
Properties
algorithm?
optionalalgorithm:HashAlgorithm
Defined in: otplib/src/class.ts:68
Hash algorithm (default: 'sha1')
counter?
optionalcounter:number
Defined in: otplib/src/class.ts:97
Counter value Used by HOTP strategy (required)
digits?
optionaldigits:Digits
Defined in: otplib/src/class.ts:73
Number of digits (default: 6)
epoch?
optionalepoch:number
Defined in: otplib/src/class.ts:79
Current Unix epoch timestamp in seconds (default: now) Used by TOTP strategy
guardrails?
optionalguardrails:OTPGuardrails
Defined in: otplib/src/class.ts:102
Validation guardrails
period?
optionalperiod:number
Defined in: otplib/src/class.ts:91
Time step in seconds (default: 30) Used by TOTP strategy
secret
secret:
string
Defined in: otplib/src/class.ts:63
Base32-encoded secret key
t0?
optionalt0:number
Defined in: otplib/src/class.ts:85
Initial Unix time to start counting time steps (default: 0) Used by TOTP strategy