-
-
Notifications
You must be signed in to change notification settings - Fork 133
Upgrading to v10
Gerald Yeo edited this page Jun 17, 2018
·
7 revisions
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