otplib API Documentation / otplib / class / OTPURIGenerateOptions
Type Alias: OTPURIGenerateOptions
OTPURIGenerateOptions =
object
Defined in: otplib/src/class.ts:207
Options for generating URI with the OTP class
Properties
algorithm?
optionalalgorithm:HashAlgorithm
Defined in: otplib/src/class.ts:229
Hash algorithm (default: 'sha1')
counter?
optionalcounter:number
Defined in: otplib/src/class.ts:246
Counter value (default: 0) Used by HOTP strategy
digits?
optionaldigits:Digits
Defined in: otplib/src/class.ts:234
Number of digits (default: 6)
issuer
issuer:
string
Defined in: otplib/src/class.ts:211
Issuer name (e.g., 'ACME Co')
label
label:
string
Defined in: otplib/src/class.ts:216
Label/Account name (e.g., 'john@example.com')
period?
optionalperiod:number
Defined in: otplib/src/class.ts:240
Time step in seconds (default: 30) Used by TOTP strategy
secret
secret:
string
Defined in: otplib/src/class.ts:224
Base32-encoded secret key
Note: By default, strings are assumed to be Base32 encoded. If you have a raw string/passphrase, you must convert it to Uint8Array first.