Skip to content

otplib API Documentation / @otplib/uri / URIOptions

Type Alias: URIOptions ​

URIOptions = object

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

Base options for URI generation

Properties ​

algorithm? ​

optional algorithm?: HashAlgorithm

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

Hash algorithm (default: 'sha1') Note: Some authenticator apps ignore this parameter; sha1 has the widest interoperability.


counter? ​

optional counter?: number

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

Counter value for HOTP


digits? ​

optional digits?: Digits

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

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:13

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


label? ​

optional label?: string

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

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


period? ​

optional period?: number

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

Time step in seconds for TOTP (default: 30)


secret ​

secret: string

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

Base32-encoded secret key

Released under the MIT License.