Skip to content

otplib API Documentation / @otplib/uri / OTPAuthParams

Type Alias: OTPAuthParams

OTPAuthParams = object

Defined in: packages/uri/src/types.ts:11

otpauth:// URI parameters

Properties

algorithm?

readonly optional algorithm?: HashAlgorithm

Defined in: packages/uri/src/types.ts:27

Hash algorithm. Parsing preserves absence; OTP consumers default to sha1. Some authenticator apps ignore this parameter; sha1 has the widest interoperability.


counter?

readonly optional counter?: number

Defined in: packages/uri/src/types.ts:40

Initial counter value for HOTP. Required by the Key URI format; parsing preserves absence, while HOTP generation helpers default to 0.


digits?

readonly optional digits?: Digits

Defined in: packages/uri/src/types.ts:34

Number of digits. Parsing preserves absence; OTP consumers default to 6. The Key URI format defines 6 or 8; some authenticator apps ignore this parameter.


issuer?

readonly optional issuer?: string

Defined in: packages/uri/src/types.ts:20

Service/provider name (recommended)


period?

readonly optional period?: number

Defined in: packages/uri/src/types.ts:48

Time step in seconds for TOTP. Parsing preserves absence; OTP consumers default to 30. Some authenticator apps ignore this parameter, so 30 has the widest interoperability.


secret

readonly secret: string

Defined in: packages/uri/src/types.ts:15

Base32-encoded shared secret (required)

Released under the MIT License.