@vizualkei/neuma-client-sdk 0.121.1 → 0.125.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 +21 -0
- package/dist/NeumaMobile.js +25 -6
- package/dist/NeumaMobileInterface.d.ts +9 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
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.
|
package/dist/NeumaMobile.js
CHANGED
|
@@ -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
|
|
897
|
-
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NEUMA_CLIENT_SDK_VERSION = "0.
|
|
1
|
+
export declare const NEUMA_CLIENT_SDK_VERSION = "0.125.0";
|
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.
|
|
5
|
+
exports.NEUMA_CLIENT_SDK_VERSION = '0.125.0';
|