otplib 13.0.0 → 13.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # otplib
2
2
 
3
- > The One-Time Password (OTP) library
3
+ TypeScript-first library for HOTP and TOTP / Authenticator with multi-runtime (Node, Bun, Deno, Browser) support via plugins.
4
4
 
5
- TypeScript-first implementation of HOTP/TOTP with automatic crypto backend detection for optimal performance across Node.js, browsers, and edge environments.
5
+ A web based demo is available at [https://otplib.yeojz.dev](https://otplib.yeojz.dev).
6
+
7
+ ## Features
8
+
9
+ - **Zero Configuration** - Works out of the box with sensible defaults
10
+ - **RFC Compliant** - RFC 6238 (TOTP) and RFC 4226 (HOTP)
11
+ - **TypeScript-First** - Full type definitions
12
+ - **Google Authenticator Compatible** - Full otpauth:// URI support
13
+ - **Plugin Interface** - Flexible plugin system for customising your cryptographic and base32 requirements (if you want to deviate from the defaults)
14
+ - **Cross-platform** - Tested against Node.js, Bun, Deno, and browsers
6
15
 
7
16
  ## Breaking Changes (v13)
8
17
 
@@ -18,23 +27,23 @@ TypeScript-first implementation of HOTP/TOTP with automatic crypto backend detec
18
27
  > - **Separate authenticator package** — TOTP now covers all authenticator functionality
19
28
  > - **Outdated plugins** — Legacy crypto adapters removed in favor of modern, audited alternatives
20
29
  >
21
- > See [Migration Guide](https://otplib.yeojz.dev/guide/migrating-v12-to-v13) for details.
22
-
23
- ## Features
24
-
25
- - **Zero Configuration** - Works out of the box with sensible defaults
26
- - **RFC Compliant** - RFC 6238 (TOTP) and RFC 4226 (HOTP)
27
- - **TypeScript-First** - Full type definitions
28
- - **Google Authenticator Compatible** - Full otpauth:// URI support
30
+ > See [Migration Guide](https://otplib.yeojz.dev/guide/v12-adapter) for details.
29
31
 
30
32
  ## Installation
31
33
 
32
34
  ```bash
35
+ # Node
33
36
  npm install otplib
34
37
  pnpm add otplib
35
38
  yarn add otplib
36
39
  ```
37
40
 
41
+ ```bash
42
+ # Other runtimes
43
+ bun add otplib
44
+ deno install npm:otplib
45
+ ```
46
+
38
47
  ## Quick Start
39
48
 
40
49
  ### Functional API (Recommended)
@@ -86,9 +95,9 @@ const uri = otp.generateURI({
86
95
 
87
96
  ## Documentation
88
97
 
89
- Full documentation available at [here](https://otplib.yeojz.dev):
98
+ Refer to the [Getting Started Guide](https://otplib.yeojz.dev/guide/getting-started), or check out the other sections in the guide:
90
99
 
91
- - [Getting Started Guide](https://otplib.yeojz.dev/guide/getting-started)
100
+ - [Advanced Usage](https://otplib.yeojz.dev/guide/advanced-usage)
92
101
  - [Runtime Compatibility](https://otplib.yeojz.dev/guide/runtime-compatibility)
93
102
  - [Security Considerations](https://otplib.yeojz.dev/guide/security)
94
103
  - [API Reference](https://otplib.yeojz.dev/api/)
@@ -0,0 +1 @@
1
+ {"inputs":{"src/defaults.ts":{"bytes":1666,"imports":[{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true}],"format":"esm"},"src/functional.ts":{"bytes":9002,"imports":[{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"src/defaults.ts","kind":"import-statement","original":"./defaults"}],"format":"esm"},"src/class.ts":{"bytes":7747,"imports":[{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"src/defaults.ts","kind":"import-statement","original":"./defaults"},{"path":"src/functional.ts","kind":"import-statement","original":"./functional"}],"format":"esm"},"src/index.ts":{"bytes":896,"imports":[{"path":"src/functional.ts","kind":"import-statement","original":"./functional"},{"path":"src/class.ts","kind":"import-statement","original":"./class"},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true},{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":25941},"dist/index.cjs":{"imports":[{"path":"@otplib/core","kind":"require-call","external":true},{"path":"@otplib/hotp","kind":"require-call","external":true},{"path":"@otplib/totp","kind":"require-call","external":true},{"path":"@otplib/uri","kind":"require-call","external":true},{"path":"@otplib/plugin-base32-scure","kind":"require-call","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"require-call","external":true},{"path":"@otplib/core","kind":"require-call","external":true},{"path":"@otplib/uri","kind":"require-call","external":true},{"path":"@otplib/hotp","kind":"require-call","external":true},{"path":"@otplib/totp","kind":"require-call","external":true},{"path":"@otplib/core","kind":"require-call","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"require-call","external":true},{"path":"@otplib/plugin-base32-scure","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":495},"src/functional.ts":{"bytesInOutput":1986},"src/defaults.ts":{"bytesInOutput":530},"src/class.ts":{"bytesInOutput":976}},"bytes":4579},"dist/functional.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15271},"dist/functional.cjs":{"imports":[{"path":"@otplib/core","kind":"require-call","external":true},{"path":"@otplib/hotp","kind":"require-call","external":true},{"path":"@otplib/totp","kind":"require-call","external":true},{"path":"@otplib/uri","kind":"require-call","external":true},{"path":"@otplib/plugin-base32-scure","kind":"require-call","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/functional.ts","inputs":{"src/functional.ts":{"bytesInOutput":2125},"src/defaults.ts":{"bytesInOutput":530}},"bytes":3170},"dist/class.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24072},"dist/class.cjs":{"imports":[{"path":"@otplib/core","kind":"require-call","external":true},{"path":"@otplib/uri","kind":"require-call","external":true},{"path":"@otplib/plugin-base32-scure","kind":"require-call","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"require-call","external":true},{"path":"@otplib/core","kind":"require-call","external":true},{"path":"@otplib/hotp","kind":"require-call","external":true},{"path":"@otplib/totp","kind":"require-call","external":true},{"path":"@otplib/uri","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/class.ts","inputs":{"src/class.ts":{"bytesInOutput":1022},"src/defaults.ts":{"bytesInOutput":530},"src/functional.ts":{"bytesInOutput":1697}},"bytes":3701}}}
@@ -0,0 +1 @@
1
+ {"inputs":{"src/defaults.ts":{"bytes":1666,"imports":[{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true}],"format":"esm"},"src/functional.ts":{"bytes":9002,"imports":[{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"src/defaults.ts","kind":"import-statement","original":"./defaults"}],"format":"esm"},"src/class.ts":{"bytes":7747,"imports":[{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"src/defaults.ts","kind":"import-statement","original":"./defaults"},{"path":"src/functional.ts","kind":"import-statement","original":"./functional"}],"format":"esm"},"src/index.ts":{"bytes":896,"imports":[{"path":"src/functional.ts","kind":"import-statement","original":"./functional"},{"path":"src/class.ts","kind":"import-statement","original":"./class"},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true},{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":25970},"dist/index.js":{"imports":[{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true},{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true},{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true}],"exports":["HOTP","NobleCryptoPlugin","OTP","ScureBase32Plugin","TOTP","generate","generateSecret","generateSync","generateURI","verify","verifySync","wrapResult","wrapResultAsync"],"entryPoint":"src/index.ts","inputs":{"src/functional.ts":{"bytesInOutput":1980},"src/defaults.ts":{"bytesInOutput":540},"src/index.ts":{"bytesInOutput":269},"src/class.ts":{"bytesInOutput":976}},"bytes":3989},"dist/functional.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":15256},"dist/functional.js":{"imports":[{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true}],"exports":["generate","generateSecret","generateSync","generateURI","verify","verifySync"],"entryPoint":"src/functional.ts","inputs":{"src/functional.ts":{"bytesInOutput":1980},"src/defaults.ts":{"bytesInOutput":540}},"bytes":2626},"dist/class.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":24227},"dist/class.js":{"imports":[{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true},{"path":"@otplib/plugin-base32-scure","kind":"import-statement","external":true},{"path":"@otplib/plugin-crypto-noble","kind":"import-statement","external":true},{"path":"@otplib/core","kind":"import-statement","external":true},{"path":"@otplib/hotp","kind":"import-statement","external":true},{"path":"@otplib/totp","kind":"import-statement","external":true},{"path":"@otplib/uri","kind":"import-statement","external":true}],"exports":["OTP"],"entryPoint":"src/class.ts","inputs":{"src/class.ts":{"bytesInOutput":976},"src/defaults.ts":{"bytesInOutput":540},"src/functional.ts":{"bytesInOutput":1725}},"bytes":3259}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otplib",
3
- "version": "13.0.0",
3
+ "version": "13.0.2",
4
4
  "description": "TypeScript-first library for TOTP and HOTP with multi-runtime and plugin support",
5
5
  "license": "MIT",
6
6
  "author": "Gerald Yeo <support@yeojz.dev>",
@@ -49,19 +49,19 @@
49
49
  "LICENSE"
50
50
  ],
51
51
  "dependencies": {
52
- "@otplib/core": "13.0.0",
53
- "@otplib/uri": "13.0.0",
54
- "@otplib/hotp": "13.0.0",
55
- "@otplib/totp": "13.0.0",
56
- "@otplib/plugin-crypto-noble": "13.0.0",
57
- "@otplib/plugin-base32-scure": "13.0.0"
52
+ "@otplib/core": "13.0.2",
53
+ "@otplib/uri": "13.0.2",
54
+ "@otplib/totp": "13.0.2",
55
+ "@otplib/plugin-crypto-noble": "13.0.2",
56
+ "@otplib/plugin-base32-scure": "13.0.2",
57
+ "@otplib/hotp": "13.0.2"
58
58
  },
59
59
  "devDependencies": {
60
60
  "tsup": "^8.0.1",
61
61
  "typescript": "^5.3.3",
62
62
  "vitest": "^4.0.16",
63
- "@otplib/plugin-crypto-noble": "13.0.0",
64
- "@repo/testing": "13.0.0"
63
+ "@otplib/plugin-crypto-noble": "13.0.2",
64
+ "@repo/testing": "13.0.1"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"