@vizualkei/neuma-client-sdk 0.121.1 → 0.125.1

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,3 +1,24 @@
1
1
  # @vizualkei/neuma-client-sdk
2
2
 
3
3
  See [README.md](../../README.md) for the Neuma SDK API documentation.
4
+
5
+ ## iOS Universal Link handoff
6
+
7
+ On iOS phone browsers the SDK hands off to the Neuma app using an HTTPS
8
+ **Universal Link** instead of the `neuma://` custom scheme. This lets the OS
9
+ open the installed app directly and avoids the "open in app?" custom-scheme
10
+ prompt.
11
+
12
+ - The Universal Link base defaults to `https://www.neuma.me/link`. The SDK
13
+ appends the same query parameters used for the deep link (`operation`, `id`,
14
+ `bioServer`, `webServer`, optional `userName`/`email`/`phone`, `nst`, and the
15
+ iOS-Safari-gated `returnUrl`), so the return-to-tab flow is identical to the
16
+ custom-scheme path.
17
+ - Override the base with the `universalLinkBase` option (passed via
18
+ `sdkOptions`) if you host your own Universal Link page.
19
+ - **App not installed:** the Universal Link navigates the current tab to
20
+ `https://www.neuma.me/link`, a hosted fallback page with install links. The
21
+ tab unloads in that case, so the usual 2s visibility-based launch-failure
22
+ detection may not fire for iOS.
23
+ - **Android is unchanged:** Android (and `unknown` platforms) continue to hand
24
+ off via the `neuma://operation` custom scheme, byte-for-byte as before.
@@ -25,6 +25,7 @@ class NeumaMobile {
25
25
  constructor() {
26
26
  this.options = {
27
27
  customSchemeBase: 'neuma://operation',
28
+ universalLinkBase: 'https://www.neuma.me/link',
28
29
  timeoutMs: 90000,
29
30
  overlay: { appName: 'Neuma Mobile' },
30
31
  apiServerPort: 443,
@@ -38,7 +39,7 @@ class NeumaMobile {
38
39
  this.versionInfo = this.parsePackageVersion(SDK_VERSION);
39
40
  }
40
41
  initialize(opts) {
41
- const { overlay, timeoutMs, onQrCode, onAppLaunchFailed, neumaSessionToken, biometricService, installUrlResolver, qrAppLinkBase, } = opts;
42
+ const { overlay, timeoutMs, onQrCode, onAppLaunchFailed, neumaSessionToken, biometricService, installUrlResolver, qrAppLinkBase, universalLinkBase, } = opts;
42
43
  this.options = {
43
44
  ...this.options,
44
45
  timeoutMs: timeoutMs ?? this.options.timeoutMs,
@@ -49,6 +50,7 @@ class NeumaMobile {
49
50
  biometricService: (0, biometricService_1.normalizeBiometricService)(biometricService ?? this.options.biometricService),
50
51
  installUrlResolver: installUrlResolver ?? this.options.installUrlResolver,
51
52
  qrAppLinkBase: qrAppLinkBase ?? this.options.qrAppLinkBase,
53
+ universalLinkBase: universalLinkBase ?? this.options.universalLinkBase,
52
54
  };
53
55
  common_utils_1.logger.info('SDK initialized', {
54
56
  timeoutMs: this.options.timeoutMs,
@@ -893,10 +895,25 @@ class NeumaMobile {
893
895
  if (returnUrl) {
894
896
  params.append('returnUrl', returnUrl);
895
897
  }
896
- const customScheme = `${this.options.customSchemeBase}?${params.toString()}`;
897
- common_utils_1.logger.info('Custom scheme prepared', {
898
+ const platform = this.detectLaunchPlatform();
899
+ // iOS: launch via Universal Link instead of the custom scheme. The
900
+ // same URLSearchParams (operation, id, bioServer, webServer, optional
901
+ // userName/email/phone, nst, and the iOS-Safari-gated returnUrl) are
902
+ // reused verbatim so the return-to-tab flow is identical.
903
+ //
904
+ // If the Neuma app is NOT installed, the Universal Link navigates this
905
+ // tab to https://www.neuma.me/link (a hosted fallback page with install
906
+ // links). In that case the page unloads, so the 2s visibility-based
907
+ // launch-failure timer below may never fire — that is accepted.
908
+ const launchUrl = platform === 'ios'
909
+ ? `${this.options.universalLinkBase}?${params.toString()}`
910
+ : `${this.options.customSchemeBase}?${params.toString()}`;
911
+ common_utils_1.logger.info('Launch URL prepared', {
898
912
  callbackId,
899
- customSchemeBase: this.options.customSchemeBase,
913
+ platform,
914
+ launchBase: platform === 'ios'
915
+ ? this.options.universalLinkBase
916
+ : this.options.customSchemeBase,
900
917
  hasReturnUrl: !!returnUrl,
901
918
  });
902
919
  let launchFailureTimer = null;
@@ -912,9 +929,11 @@ class NeumaMobile {
912
929
  cancelLaunchFailureTimer();
913
930
  };
914
931
  document.addEventListener('visibilitychange', onVisibility);
915
- // Open app immediately using custom scheme
932
+ // Open app immediately. iOS uses the Universal Link; all other
933
+ // platforms use the custom scheme. Launch synchronously in the same
934
+ // call stack (no setTimeout/promise deferral).
916
935
  try {
917
- window.location.href = customScheme;
936
+ window.location.href = launchUrl;
918
937
  }
919
938
  catch { }
920
939
  // Infer failed launches only for phone-browser deep-link flow.
@@ -79,6 +79,15 @@ export type NeumaMobileOptions = {
79
79
  * `/neuma-wellness/f` or `https://apps.example.com/neuma-wellness/f`.
80
80
  */
81
81
  qrAppLinkBase?: string;
82
+ /**
83
+ * HTTPS Universal Link base used for the iOS phone-browser handoff.
84
+ *
85
+ * Defaults to `https://www.neuma.me/link`. On iOS the SDK launches this
86
+ * URL instead of the `neuma://` custom scheme so the OS can open the
87
+ * installed app directly; if the app is not installed, the link falls
88
+ * back to a hosted install page. Android handoff is unaffected.
89
+ */
90
+ universalLinkBase?: string;
82
91
  /** Biometric session token (NST) from the server */
83
92
  neumaSessionToken?: string;
84
93
  /**
package/dist/index.d.ts CHANGED
@@ -4,4 +4,4 @@ export type { NeumaMobileInterface, NeumaMobileOptions, UserDescriptor, Enrollme
4
4
  export { NeumaError } from './NeumaMobileInterface';
5
5
  export { NeumaClient, neumaClient, } from './NeumaClient';
6
6
  export type { NeumaClientConfig, EnrollUserOptions, HandlePendingOperationOptions, PendingOperationErrorContext, PendingOperationMatcher, PendingOperationResult, } from './NeumaClient';
7
- export { NEUMA_MOBILE_PLAY_STORE_URL, NEUMA_MOBILE_TESTFLIGHT_URL, getNeumaMobileInstallUrl, } from './installLinks';
7
+ export { NEUMA_MOBILE_APP_STORE_URL, NEUMA_MOBILE_PLAY_STORE_URL, NEUMA_MOBILE_TESTFLIGHT_URL, getNeumaMobileInstallUrl, } from './installLinks';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNeumaMobileInstallUrl = exports.NEUMA_MOBILE_TESTFLIGHT_URL = exports.NEUMA_MOBILE_PLAY_STORE_URL = exports.neumaClient = exports.NeumaClient = exports.NeumaError = exports.NEUMA_CLIENT_SDK_VERSION = exports.NeumaMobileFactory = void 0;
3
+ exports.getNeumaMobileInstallUrl = exports.NEUMA_MOBILE_TESTFLIGHT_URL = exports.NEUMA_MOBILE_PLAY_STORE_URL = exports.NEUMA_MOBILE_APP_STORE_URL = exports.neumaClient = exports.NeumaClient = exports.NeumaError = exports.NEUMA_CLIENT_SDK_VERSION = exports.NeumaMobileFactory = void 0;
4
4
  // Neuma Client SDK - Main exports
5
5
  var NeumaMobile_1 = require("./NeumaMobile");
6
6
  Object.defineProperty(exports, "NeumaMobileFactory", { enumerable: true, get: function () { return NeumaMobile_1.NeumaMobileFactory; } });
@@ -13,6 +13,7 @@ var NeumaClient_1 = require("./NeumaClient");
13
13
  Object.defineProperty(exports, "NeumaClient", { enumerable: true, get: function () { return NeumaClient_1.NeumaClient; } });
14
14
  Object.defineProperty(exports, "neumaClient", { enumerable: true, get: function () { return NeumaClient_1.neumaClient; } });
15
15
  var installLinks_1 = require("./installLinks");
16
+ Object.defineProperty(exports, "NEUMA_MOBILE_APP_STORE_URL", { enumerable: true, get: function () { return installLinks_1.NEUMA_MOBILE_APP_STORE_URL; } });
16
17
  Object.defineProperty(exports, "NEUMA_MOBILE_PLAY_STORE_URL", { enumerable: true, get: function () { return installLinks_1.NEUMA_MOBILE_PLAY_STORE_URL; } });
17
18
  Object.defineProperty(exports, "NEUMA_MOBILE_TESTFLIGHT_URL", { enumerable: true, get: function () { return installLinks_1.NEUMA_MOBILE_TESTFLIGHT_URL; } });
18
19
  Object.defineProperty(exports, "getNeumaMobileInstallUrl", { enumerable: true, get: function () { return installLinks_1.getNeumaMobileInstallUrl; } });
@@ -1,4 +1,6 @@
1
1
  import type { AppLaunchPlatform } from './NeumaMobileInterface';
2
2
  export declare const NEUMA_MOBILE_PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=io.vizualkei.neuma";
3
- export declare const NEUMA_MOBILE_TESTFLIGHT_URL = "https://testflight.apple.com/join/yAv6ZB2S";
3
+ export declare const NEUMA_MOBILE_APP_STORE_URL = "https://apps.apple.com/us/app/neuma-id/id6769588036";
4
+ /** @deprecated Use NEUMA_MOBILE_APP_STORE_URL. */
5
+ export declare const NEUMA_MOBILE_TESTFLIGHT_URL = "https://apps.apple.com/us/app/neuma-id/id6769588036";
4
6
  export declare const getNeumaMobileInstallUrl: (platform: AppLaunchPlatform) => string | undefined;
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNeumaMobileInstallUrl = exports.NEUMA_MOBILE_TESTFLIGHT_URL = exports.NEUMA_MOBILE_PLAY_STORE_URL = void 0;
3
+ exports.getNeumaMobileInstallUrl = exports.NEUMA_MOBILE_TESTFLIGHT_URL = exports.NEUMA_MOBILE_APP_STORE_URL = exports.NEUMA_MOBILE_PLAY_STORE_URL = void 0;
4
4
  exports.NEUMA_MOBILE_PLAY_STORE_URL = 'https://play.google.com/store/apps/details?id=io.vizualkei.neuma';
5
- exports.NEUMA_MOBILE_TESTFLIGHT_URL = 'https://testflight.apple.com/join/yAv6ZB2S';
5
+ exports.NEUMA_MOBILE_APP_STORE_URL = 'https://apps.apple.com/us/app/neuma-id/id6769588036';
6
+ /** @deprecated Use NEUMA_MOBILE_APP_STORE_URL. */
7
+ exports.NEUMA_MOBILE_TESTFLIGHT_URL = exports.NEUMA_MOBILE_APP_STORE_URL;
6
8
  const getNeumaMobileInstallUrl = (platform) => {
7
9
  if (platform === 'android') {
8
10
  return exports.NEUMA_MOBILE_PLAY_STORE_URL;
9
11
  }
10
12
  if (platform === 'ios') {
11
- return exports.NEUMA_MOBILE_TESTFLIGHT_URL;
13
+ return exports.NEUMA_MOBILE_APP_STORE_URL;
12
14
  }
13
15
  return undefined;
14
16
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const NEUMA_CLIENT_SDK_VERSION = "0.121.1";
1
+ export declare const NEUMA_CLIENT_SDK_VERSION = "0.125.1";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NEUMA_CLIENT_SDK_VERSION = void 0;
4
4
  // This file is generated by scripts/generate-package-version.mjs. Do not edit by hand.
5
- exports.NEUMA_CLIENT_SDK_VERSION = '0.121.1';
5
+ exports.NEUMA_CLIENT_SDK_VERSION = '0.125.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizualkei/neuma-client-sdk",
3
- "version": "0.121.1",
3
+ "version": "0.125.1",
4
4
  "description": "Neuma Web Client SDK - Biometric verification SDK for webapp integration",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",