Skip to main content

Interface: TOTPConfig

Defined in: src/auth/types.ts:99

Configuration for a TOTP (RFC 6238) issuer. Used both to generate the otpauth:// provisioning URI (the "Key URI Format" companion convention supported by virtually every TOTP authenticator app, e.g. Google Authenticator/Authy/1Password) for enrolling a new secret, and as the default token parameters for newly registered secrets.

Properties

algorithm?

optional algorithm?: TOTPAlgorithm

Defined in: src/auth/types.ts:110

The HMAC hash algorithm used to generate tokens. Default is "sha1" — the only algorithm universally supported by authenticator apps despite RFC 6238 permitting SHA-256/SHA-512.


digits?

optional digits?: number

Defined in: src/auth/types.ts:103

The number of digits each generated token contains. Default is 6.


epochTolerance?

optional epochTolerance?: number | number[]

Defined in: src/auth/types.ts:116

Specifies a tolerance window around the current time. It does not represent a strict duration in seconds (e.g., "±N seconds"), but rather dictates which periods overlap with the tolerance window [currentTime - tolerance, currentTime + tolerance]. Default value is [5, 0].


issuer

issuer: string

Defined in: src/auth/types.ts:101

The human-readable name of the issuing service, shown to the user by the authenticator app.


period?

optional period?: number

Defined in: src/auth/types.ts:105

The time step, in seconds, that each generated token remains valid for. Default is 30.