@octane-xplat/biometrics 0.18.0 → 0.19.0

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,15 +1,15 @@
1
1
  # `@octane-xplat/biometrics`
2
2
 
3
- ```sh
4
- pnpm add @octane-xplat/biometrics
5
- ```
6
-
7
3
  Local biometric verification — Face ID / Touch ID / fingerprint or device
8
4
  credential — behind one capability object. iOS and Android run
9
5
  `@nativescript/biometrics`; macOS AppKit uses Apple LocalAuthentication
10
6
  for Touch ID. Web reports `supported: false` because WebAuthn requires
11
7
  a registered credential and an authentication ceremony.
12
8
 
9
+ ```sh
10
+ bun add @octane-xplat/biometrics
11
+ ```
12
+
13
13
  ```ts
14
14
  import { biometrics } from '@octane-xplat/biometrics'
15
15
 
@@ -43,7 +43,7 @@ if (availability.granted) {
43
43
  }
44
44
  ```
45
45
 
46
- Guide: [Using device features](../../docs/platform/platform-services.md);
47
- per-target availability: [platform notes](../../.agents/docs/notes/platform-notes.md).
46
+ Guide: [Using device features](https://octane-xplat.goddardai.org/platform-services);
47
+ per-target availability: [platform notes](https://github.com/octane-xplat/octane-xplat/blob/main/.agents/docs/notes/platform-notes.md).
48
48
  Exercised by the harness `Services` screen
49
- ([`packages/app/src/Services.tsrx`](../app/src/Services.tsrx)).
49
+ ([`packages/app/src/Services.tsrx`](https://github.com/octane-xplat/octane-xplat/blob/main/packages/app/src/Services.tsrx)).
package/package.json CHANGED
@@ -1,92 +1,90 @@
1
1
  {
2
- "name": "@octane-xplat/biometrics",
3
- "version": "0.18.0",
4
- "description": "Biometric verification (FaceID/TouchID/fingerprint) for Octane xplat — matching web + NativeScript implementations",
5
- "keywords": [
6
- "android",
7
- "biometrics",
8
- "cross-platform",
9
- "faceid",
10
- "fingerprint",
11
- "ios",
12
- "nativescript",
13
- "octane",
14
- "touchid",
15
- "web",
16
- "xplat"
17
- ],
18
- "homepage": "https://github.com/octane-xplat/octane-xplat/tree/main/packages/biometrics",
19
- "license": "MIT",
20
- "repository": {
21
- "type": "git",
22
- "url": "https://github.com/octane-xplat/octane-xplat",
23
- "directory": "packages/biometrics"
24
- },
25
- "files": [
26
- "src",
27
- "types",
28
- "!src/**/*.test.*",
29
- "!src/**/*.spec.*"
30
- ],
31
- "type": "module",
32
- "exports": {
33
- ".": {
34
- "macos": {
35
- "types": "./types/generated/index.macos.d.ts",
36
- "default": "./src/index.macos.ts"
37
- },
38
- "types": "./types/generated/index.d.ts",
39
- "default": "./src/index.ts"
40
- },
41
- "./*": {
42
- "types": "./types/generated/*.d.ts",
43
- "default": "./src/*"
44
- },
45
- "./*.ts": {
46
- "types": "./types/generated/*.d.ts",
47
- "default": "./src/*.ts"
48
- }
49
- },
50
- "publishConfig": {
51
- "access": "public"
52
- },
53
- "dependencies": {
54
- "@nativescript/biometrics": "1.3.1",
55
- "@octane-xplat/lib": "0.18.0"
56
- },
57
- "devDependencies": {
58
- "@nativescript-community/octane": "0.2.5",
59
- "@nativescript/core": "9.1.3",
60
- "@nativescript/types": "9.1.4",
61
- "@tsrx/typescript-plugin": "0.4.11",
62
- "octane": "0.14.0",
63
- "tsrx-typegen": "0.4.0",
64
- "typescript": "5.9.3"
65
- },
66
- "peerDependencies": {
67
- "@nativescript-community/octane": ">=0.2.1 <1",
68
- "@nativescript/core": ">=9.1.0 <10",
69
- "octane": ">=0.6.3 <1"
70
- },
71
- "peerDependenciesMeta": {
72
- "@nativescript-community/octane": {
73
- "optional": true
74
- },
75
- "@nativescript/core": {
76
- "optional": true
77
- }
78
- },
79
- "nativescript": {
80
- "platforms": {
81
- "android": "9.1.0",
82
- "ios": "9.1.0"
83
- }
84
- },
85
- "scripts": {
86
- "test:packed": "node tests/packed-consumer.mjs",
87
- "test": "node --test tests/*.test.mjs",
88
- "test:macos-runtime": "node ../../apps/macos/test/verify-biometrics.mjs",
89
- "typegen": "tsrx-typegen --project tsconfig.types.json",
90
- "pack:check": "tsrx-typegen --pack-check"
91
- }
92
- }
2
+ "name": "@octane-xplat/biometrics",
3
+ "version": "0.19.0",
4
+ "description": "Biometric verification (FaceID/TouchID/fingerprint) for Octane xplat — matching web + NativeScript implementations",
5
+ "keywords": [
6
+ "android",
7
+ "biometrics",
8
+ "cross-platform",
9
+ "faceid",
10
+ "fingerprint",
11
+ "ios",
12
+ "nativescript",
13
+ "octane",
14
+ "touchid",
15
+ "web",
16
+ "xplat"
17
+ ],
18
+ "homepage": "https://github.com/octane-xplat/octane-xplat/tree/main/packages/biometrics",
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/octane-xplat/octane-xplat",
23
+ "directory": "packages/biometrics"
24
+ },
25
+ "files": [
26
+ "src",
27
+ "types",
28
+ "!src/**/*.test.*",
29
+ "!src/**/*.spec.*"
30
+ ],
31
+ "type": "module",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./types/generated/index.d.ts",
35
+ "macos": "./src/index.macos.ts",
36
+ "default": "./src/index.ts"
37
+ },
38
+ "./*": {
39
+ "types": "./types/generated/*.d.ts",
40
+ "default": "./src/*"
41
+ },
42
+ "./*.ts": {
43
+ "types": "./types/generated/*.d.ts",
44
+ "default": "./src/*.ts"
45
+ }
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "scripts": {
51
+ "test:packed": "node tests/packed-consumer.mjs",
52
+ "test": "node --test tests/*.test.mjs",
53
+ "test:macos-runtime": "node ../../apps/macos/test/verify-biometrics.mjs",
54
+ "typegen": "tsrx-typegen --project tsconfig.types.json",
55
+ "prepack": "bun run typegen && tsrx-typegen --pack-check",
56
+ "pack:check": "tsrx-typegen --pack-check"
57
+ },
58
+ "dependencies": {
59
+ "@nativescript/biometrics": "1.3.1",
60
+ "@octane-xplat/lib": "0.19.0"
61
+ },
62
+ "devDependencies": {
63
+ "@nativescript-community/octane": "0.2.5",
64
+ "@nativescript/core": "9.1.3",
65
+ "@nativescript/types": "9.1.4",
66
+ "@tsrx/typescript-plugin": "0.4.11",
67
+ "octane": "0.16.3",
68
+ "tsrx-typegen": "0.5.0",
69
+ "typescript": "5.9.3"
70
+ },
71
+ "peerDependencies": {
72
+ "@nativescript-community/octane": ">=0.2.1 <1",
73
+ "@nativescript/core": ">=9.1.0 <10",
74
+ "octane": ">=0.6.3 <1"
75
+ },
76
+ "peerDependenciesMeta": {
77
+ "@nativescript-community/octane": {
78
+ "optional": true
79
+ },
80
+ "@nativescript/core": {
81
+ "optional": true
82
+ }
83
+ },
84
+ "nativescript": {
85
+ "platforms": {
86
+ "android": "9.1.0",
87
+ "ios": "9.1.0"
88
+ }
89
+ }
90
+ }
package/src/biometrics.ts CHANGED
@@ -30,6 +30,7 @@ const available = async (): Promise<PermissionResponse> => {
30
30
  }
31
31
  }
32
32
 
33
+ /** Biometrics service backed by @nativescript/biometrics. */
33
34
  export const biometrics: Permissioned<BiometricsImpl> = {
34
35
  supported: true,
35
36
  isAvailable: async () => (await available()).granted,
@@ -37,25 +38,25 @@ export const biometrics: Permissioned<BiometricsImpl> = {
37
38
  requestPermissions: available,
38
39
  async verify(reason) {
39
40
  if (verifying) {
40
- return false
41
- }
41
+ return false
42
+ }
42
43
 
43
- verifying = true
44
- try {
45
- // iOS ignores `title` on its default keychain path — route
46
- // through LAContext (pinFallback selects that path; customFallback
47
- // keeps the biometrics-only policy) so `message` surfaces the
48
- // caller's reason, matching Android's dialog title.
49
- const options: VerifyBiometricOptions = isIOS
50
- ? { title: reason, message: reason, pinFallback: true, ios: { customFallback: true } }
51
- : { title: reason }
44
+ verifying = true
45
+ try {
46
+ // iOS ignores `title` on its default keychain path — route
47
+ // through LAContext (pinFallback selects that path; customFallback
48
+ // keeps the biometrics-only policy) so `message` surfaces the
49
+ // caller's reason, matching Android's dialog title.
50
+ const options: VerifyBiometricOptions = isIOS
51
+ ? { title: reason, message: reason, pinFallback: true, ios: { customFallback: true } }
52
+ : { title: reason }
52
53
 
53
- const r = await bio.verifyBiometric(options)
54
- return r.code === 0
55
- } catch {
56
- return false
57
- } finally {
58
- verifying = false
59
- }
54
+ const r = await bio.verifyBiometric(options)
55
+ return r.code === 0
56
+ } catch {
57
+ return false
58
+ } finally {
59
+ verifying = false
60
+ }
60
61
  },
61
62
  }
package/src/types.ts CHANGED
@@ -1,4 +1,9 @@
1
+ /** Biometric verification façade (Face ID / Touch ID / Android BIOMETRIC_STRONG). */
1
2
  export interface BiometricsImpl {
3
+ /** Prompt the user for biometric verification, showing `reason` as the
4
+ * dialog title/message. Resolves false on failure, cancel, or lockout —
5
+ * it does not reject. Only one prompt runs at a time; overlapping calls
6
+ * resolve false immediately rather than queuing. */
2
7
  verify(reason: string): Promise<boolean>
3
8
  }
4
9
 
@@ -1,3 +1,4 @@
1
1
  import type { Permissioned } from '@octane-xplat/lib/capability';
2
2
  import type { BiometricsImpl } from './types.js';
3
+ /** Biometrics service backed by @nativescript/biometrics. */
3
4
  export declare const biometrics: Permissioned<BiometricsImpl>;
@@ -1,4 +1,9 @@
1
+ /** Biometric verification façade (Face ID / Touch ID / Android BIOMETRIC_STRONG). */
1
2
  export interface BiometricsImpl {
3
+ /** Prompt the user for biometric verification, showing `reason` as the
4
+ * dialog title/message. Resolves false on failure, cancel, or lockout —
5
+ * it does not reject. Only one prompt runs at a time; overlapping calls
6
+ * resolve false immediately rather than queuing. */
2
7
  verify(reason: string): Promise<boolean>;
3
8
  }
4
9
  export { UnavailabilityError } from '@octane-xplat/lib/capability';
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2026 Alec Larson
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.