otplib API Documentation / otplib / OTPFunctionalOptions
Type Alias: OTPFunctionalOptions
OTPFunctionalOptions =
object
Defined in: otplib/src/types.ts:44
Common options for OTP generation
These options apply to both TOTP and HOTP strategies.
Properties
algorithm?
optionalalgorithm:HashAlgorithm
Defined in: otplib/src/types.ts:75
Hash algorithm (default: 'sha1')
base32?
optionalbase32:Base32Plugin
Defined in: otplib/src/types.ts:65
Base32 plugin to use (default: ScureBase32Plugin)
counter?
optionalcounter:number
Defined in: otplib/src/types.ts:104
Counter value Used by HOTP strategy (required)
crypto?
optionalcrypto:CryptoPlugin
Defined in: otplib/src/types.ts:60
Crypto plugin to use (default: NobleCryptoPlugin)
digits?
optionaldigits:Digits
Defined in: otplib/src/types.ts:80
Number of digits (default: 6)
epoch?
optionalepoch:number
Defined in: otplib/src/types.ts:92
Current Unix epoch timestamp in seconds (default: now) Used by TOTP strategy
guardrails?
optionalguardrails:OTPGuardrails
Defined in: otplib/src/types.ts:70
Validation guardrails
period?
optionalperiod:number
Defined in: otplib/src/types.ts:86
Time step in seconds (default: 30) Used by TOTP strategy
secret
secret:
string
Defined in: otplib/src/types.ts:48
Base32-encoded secret key
strategy?
optionalstrategy:OTPStrategy
Defined in: otplib/src/types.ts:55
OTP strategy to use (default: 'totp')
- 'totp': Time-based OTP
- 'hotp': HMAC-based OTP
t0?
optionalt0:number
Defined in: otplib/src/types.ts:98
Initial Unix time to start counting time steps (default: 0) Used by TOTP strategy