Skip to content

otplib API Documentation / @otplib/uri / URIOptions

Type Alias: URIOptions

URIOptions = object

Defined in: packages/uri/src/generate.ts:7

Base options for URI generation

Properties

algorithm?

optional algorithm: HashAlgorithm

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

Hash algorithm (default: 'sha1') Note: Google Authenticator only supports sha1


counter?

optional counter: number

Defined in: packages/uri/src/generate.ts:43

Counter value for HOTP


digits?

optional digits: Digits

Defined in: packages/uri/src/generate.ts:33

Number of digits (default: 6) Google Authenticator supports 6 or 8, RFC also allows 7


issuer?

optional issuer: string

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

Service/provider name (e.g., 'ACME Co', 'GitHub', 'AWS')


label?

optional label: string

Defined in: packages/uri/src/generate.ts:16

Account identifier (e.g., email, username)


period?

optional period: number

Defined in: packages/uri/src/generate.ts:38

Time step in seconds for TOTP (default: 30)


secret

secret: string

Defined in: packages/uri/src/generate.ts:21

Base32-encoded secret key

Released under the MIT License.