Skip to content
Gerald Yeo edited this page Jun 17, 2018 · 7 revisions

Table of Contents


Deprecations

otplib/core default exports

When importing the root module, i.e. import otplib from 'otplib', the classes for Authenticator, TOTP, HOTP are no longer exported. Only their instances are exported.

# original
export default {
  Authenticator,
  TOTP,
  HOTP,
  authenticator,
  totp,
  hotp
}

# new 
export default {
  authenticator,
  totp,
  hotp
}

This is to minimise confusion as well as simplify the TypeScript definitions.

The classes are still available via the class prototype. e.g. otplib.hotp.HOTP

Clone this wiki locally