otplib API Documentation / @otplib/hotp / HOTPOptions
Type Alias: HOTPOptions
HOTPOptions =
object
Defined in: hotp/src/types.ts:22
HOTP configuration options
All properties are optional for flexible class-based configuration. Use HOTPGenerateOptions or HOTPVerifyOptions for function parameters where certain fields are required.
Properties
algorithm?
readonlyoptionalalgorithm:HashAlgorithm
Defined in: hotp/src/types.ts:28
Hash algorithm to use (default: 'sha1')
base32?
readonlyoptionalbase32:Base32Plugin
Defined in: hotp/src/types.ts:34
Base32 plugin to decode string secrets (required if secret is a string)
counter?
readonlyoptionalcounter:number|bigint
Defined in: hotp/src/types.ts:26
The counter value (8-byte unsigned integer)
crypto?
readonlyoptionalcrypto:CryptoPlugin
Defined in: hotp/src/types.ts:32
Crypto plugin to use for HMAC operations
digits?
readonlyoptionaldigits:Digits
Defined in: hotp/src/types.ts:30
Number of digits in the OTP code (default: 6)
guardrails?
readonlyoptionalguardrails:OTPGuardrails
Defined in: hotp/src/types.ts:44
Custom guardrails to override validation limits Must be created via createGuardrails() factory Use this carefully - see danger-zone documentation
issuer?
readonlyoptionalissuer:string
Defined in: hotp/src/types.ts:36
Service provider name (for URI generation)
label?
readonlyoptionallabel:string
Defined in: hotp/src/types.ts:38
User identifier/email/username (for URI generation)
secret?
readonlyoptionalsecret:string|Uint8Array
Defined in: hotp/src/types.ts:24
The shared secret key (Base32-encoded string or raw bytes)