@noy-db/on-webauthn 0.1.0-pre.3 → 0.1.0-pre.4

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.
Files changed (2) hide show
  1. package/README.md +21 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -16,6 +16,27 @@ pnpm add @noy-db/hub @noy-db/on-webauthn
16
16
 
17
17
  WebAuthn hardware-key keyrings for noy-db — Touch ID, Face ID, Windows Hello, YubiKey, FIDO2 passkeys
18
18
 
19
+ ## Plumbing into `createNoydb`
20
+
21
+ `unlockWebAuthn(enrollment)` returns an `UnlockedKeyring`. As of `@noy-db/hub@0.1.0-pre.4` ([issue #5](https://github.com/vLannaAi/noy-db/issues/5)), pass it directly to `createNoydb` via the `getKeyring` callback — no passphrase bridge required:
22
+
23
+ ```ts
24
+ import { createNoydb } from '@noy-db/hub'
25
+ import { unlockWebAuthn } from '@noy-db/on-webauthn'
26
+
27
+ const enrollment = await loadEnrollmentFromIDB() // your storage of choice
28
+
29
+ const db = await createNoydb({
30
+ store,
31
+ user: 'alice',
32
+ getKeyring: (vault) => unlockWebAuthn(enrollment),
33
+ })
34
+ ```
35
+
36
+ The callback is invoked lazily on the first `openVault(name)` per vault and the keyring is cached for the lifetime of the instance. `secret` and `getKeyring` are mutually exclusive — provide exactly one.
37
+
38
+ For first-time bootstrap (no enrollment exists yet), open the vault with a passphrase, enroll WebAuthn from the unlocked keyring (`enrollWebAuthn(keyring, ...)`), persist the enrollment, then swap to `getKeyring` on subsequent sessions.
39
+
19
40
  ## Status
20
41
 
21
42
  **Pre-release** (`0.1.0-pre.1`). API may change before `1.0`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noy-db/on-webauthn",
3
- "version": "0.1.0-pre.3",
3
+ "version": "0.1.0-pre.4",
4
4
  "description": "WebAuthn hardware-key keyrings for noy-db — Touch ID, Face ID, Windows Hello, YubiKey, FIDO2 passkeys",
5
5
  "license": "MIT",
6
6
  "author": "vLannaAi <vicio@lanna.ai>",
@@ -39,10 +39,10 @@
39
39
  "node": ">=18.0.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@noy-db/hub": "0.1.0-pre.3"
42
+ "@noy-db/hub": "0.1.0-pre.4"
43
43
  },
44
44
  "devDependencies": {
45
- "@noy-db/hub": "0.1.0-pre.3"
45
+ "@noy-db/hub": "0.1.0-pre.4"
46
46
  },
47
47
  "keywords": [
48
48
  "noy-db",