@openfort/react-native 1.0.6 → 1.0.8
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/dist/core/provider.js +1 -0
- package/dist/hooks/core/index.js +1 -1
- package/dist/hooks/core/{usePasskeySupport.js → usePasskeyPrfSupport.js} +6 -8
- package/dist/native/index.js +1 -1
- package/dist/native/passkey.js +10 -3
- package/dist/types/core/provider.d.ts +2 -0
- package/dist/types/hooks/core/index.d.ts +1 -1
- package/dist/types/hooks/core/usePasskeyPrfSupport.d.ts +11 -0
- package/dist/types/native/index.d.ts +1 -1
- package/dist/types/native/passkey.d.ts +3 -3
- package/package.json +2 -2
- package/dist/types/hooks/core/usePasskeySupport.d.ts +0 -13
package/dist/core/provider.js
CHANGED
|
@@ -125,6 +125,7 @@ export const OpenfortProvider = ({ children, publishableKey, supportedChains, wa
|
|
|
125
125
|
shieldDebug: walletConfig.debug,
|
|
126
126
|
passkeyRpId: walletConfig.passkeyRpId,
|
|
127
127
|
passkeyRpName: walletConfig.passkeyRpName,
|
|
128
|
+
passkeyDisplayName: walletConfig.passkeyDisplayName,
|
|
128
129
|
})
|
|
129
130
|
: undefined,
|
|
130
131
|
overrides: {
|
package/dist/hooks/core/index.js
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
// Core SDK hooks
|
|
7
7
|
export { useOpenfort } from './useOpenfort';
|
|
8
8
|
export { useOpenfortClient } from './useOpenfortClient';
|
|
9
|
-
export {
|
|
9
|
+
export { usePasskeyPrfSupport } from './usePasskeyPrfSupport';
|
|
10
10
|
export { useUser } from './useUser';
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { isPasskeyPrfSupported } from '../../native/passkey';
|
|
3
3
|
/**
|
|
4
|
-
* Hook to detect if the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* PRF support can only be determined during passkey creation via the
|
|
8
|
-
* `clientExtensionResults.prf.enabled` field in the response.
|
|
4
|
+
* Hook to detect if the device supports passkey-based wallet recovery with the PRF extension.
|
|
5
|
+
* Requires Android 14+ (API 34) or iOS 18+. On older versions or other platforms, returns
|
|
6
|
+
* `isSupported: false`. Use to conditionally show passkey options in your UI.
|
|
9
7
|
*
|
|
10
8
|
* @returns Object with `isSupported` boolean and `isLoading` state
|
|
11
9
|
*/
|
|
12
|
-
export function
|
|
10
|
+
export function usePasskeyPrfSupport() {
|
|
13
11
|
const [isSupported, setIsSupported] = useState(false);
|
|
14
12
|
const [isLoading, setIsLoading] = useState(true);
|
|
15
13
|
useEffect(() => {
|
|
16
14
|
async function checkSupport() {
|
|
17
15
|
try {
|
|
18
|
-
const available = await
|
|
16
|
+
const available = await isPasskeyPrfSupported();
|
|
19
17
|
setIsSupported(available);
|
|
20
18
|
}
|
|
21
19
|
catch {
|
package/dist/native/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// OAuth flows
|
|
2
2
|
export { authenticateWithApple, createOAuthRedirectUri, isAppleSignInAvailable, OAuthUtils, openOAuthSession, parseOAuthUrl, } from './oauth';
|
|
3
3
|
// Passkey handler and support checks
|
|
4
|
-
export { getPasskeyDiagnostics,
|
|
4
|
+
export { getPasskeyDiagnostics, isPasskeyPrfSupported, NativePasskeyHandler } from './passkey';
|
|
5
5
|
// Storage utilities
|
|
6
6
|
export { handleSecureStorageMessage, isSecureStorageMessage, NativeStorageUtils, } from './storage';
|
|
7
7
|
export { EmbeddedWalletWebView, WebViewUtils } from './webview';
|
package/dist/native/passkey.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PasskeyAssertionFailedError, PasskeyCreationFailedError, PasskeyPRFNotSupportedError, PasskeySeedInvalidError, PasskeyUserCancelledError, } from '@openfort/openfort-js';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
2
3
|
import { logger } from '../lib/logger';
|
|
3
4
|
/**
|
|
4
5
|
* Utility functions for passkey operations in React Native.
|
|
@@ -110,10 +111,16 @@ export function getPasskeyDiagnostics() {
|
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
113
|
/**
|
|
113
|
-
* Checks if the device supports passkeys (WebAuthn)
|
|
114
|
-
*
|
|
114
|
+
* Checks if the device supports passkeys (WebAuthn) with PRF extension. Requires Android 14+ or iOS 18+.
|
|
115
|
+
* Uses the library's isSupported() after platform version check. No credential creation.
|
|
115
116
|
*/
|
|
116
|
-
export async function
|
|
117
|
+
export async function isPasskeyPrfSupported() {
|
|
118
|
+
if (Platform.OS === 'android' && Platform.Version < 34)
|
|
119
|
+
return false;
|
|
120
|
+
if (Platform.OS === 'ios' && parseInt(String(Platform.Version), 10) < 18)
|
|
121
|
+
return false;
|
|
122
|
+
if (Platform.OS !== 'android' && Platform.OS !== 'ios')
|
|
123
|
+
return false;
|
|
117
124
|
const api = getPasskeysAPI();
|
|
118
125
|
if (!api || api.isSupported == null) {
|
|
119
126
|
return false;
|
|
@@ -14,6 +14,8 @@ export type CommonEmbeddedWalletConfiguration = {
|
|
|
14
14
|
passkeyRpId?: string;
|
|
15
15
|
/** Passkey Relying Party Name for passkey-based recovery */
|
|
16
16
|
passkeyRpName?: string;
|
|
17
|
+
/** Display name shown next to the passkey credential in passkey dialogs. Defaults to "Openfort - Embedded Wallet". */
|
|
18
|
+
passkeyDisplayName?: string;
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* Parameters passed to the encryption session callback
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { useOpenfort } from './useOpenfort';
|
|
7
7
|
export { useOpenfortClient } from './useOpenfortClient';
|
|
8
|
-
export {
|
|
8
|
+
export { usePasskeyPrfSupport } from './usePasskeyPrfSupport';
|
|
9
9
|
export { useUser } from './useUser';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to detect if the device supports passkey-based wallet recovery with the PRF extension.
|
|
3
|
+
* Requires Android 14+ (API 34) or iOS 18+. On older versions or other platforms, returns
|
|
4
|
+
* `isSupported: false`. Use to conditionally show passkey options in your UI.
|
|
5
|
+
*
|
|
6
|
+
* @returns Object with `isSupported` boolean and `isLoading` state
|
|
7
|
+
*/
|
|
8
|
+
export declare function usePasskeyPrfSupport(): {
|
|
9
|
+
isSupported: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { AppleAuthResult, OAuthResult, OAuthSessionConfig, } from './oauth';
|
|
2
2
|
export { authenticateWithApple, createOAuthRedirectUri, isAppleSignInAvailable, OAuthUtils, openOAuthSession, parseOAuthUrl, } from './oauth';
|
|
3
3
|
export type { NativePasskeyHandlerConfig, PasskeysAPI } from './passkey';
|
|
4
|
-
export { getPasskeyDiagnostics,
|
|
4
|
+
export { getPasskeyDiagnostics, isPasskeyPrfSupported, NativePasskeyHandler } from './passkey';
|
|
5
5
|
export type { SecureStorageMessage, SecureStorageResponse, } from './storage';
|
|
6
6
|
export { handleSecureStorageMessage, isSecureStorageMessage, NativeStorageUtils, } from './storage';
|
|
7
7
|
export { EmbeddedWalletWebView, WebViewUtils } from './webview';
|
|
@@ -49,10 +49,10 @@ export declare function getPasskeyDiagnostics(): {
|
|
|
49
49
|
moduleLoaded: boolean;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
|
-
* Checks if the device supports passkeys (WebAuthn)
|
|
53
|
-
*
|
|
52
|
+
* Checks if the device supports passkeys (WebAuthn) with PRF extension. Requires Android 14+ or iOS 18+.
|
|
53
|
+
* Uses the library's isSupported() after platform version check. No credential creation.
|
|
54
54
|
*/
|
|
55
|
-
export declare function
|
|
55
|
+
export declare function isPasskeyPrfSupported(): Promise<boolean>;
|
|
56
56
|
export interface NativePasskeyHandlerConfig {
|
|
57
57
|
rpId?: string;
|
|
58
58
|
rpName?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfort/react-native",
|
|
3
3
|
"main": "dist/index.js",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "React Native SDK for Openfort platform integration",
|
|
7
7
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@openfort/openfort-js": "^1.1.
|
|
27
|
+
"@openfort/openfort-js": "^1.1.7",
|
|
28
28
|
"react-native-passkeys": "0.4.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook to detect if the platform supports passkeys (WebAuthn).
|
|
3
|
-
*
|
|
4
|
-
* Note: This only checks basic passkey support, not PRF extension support.
|
|
5
|
-
* PRF support can only be determined during passkey creation via the
|
|
6
|
-
* `clientExtensionResults.prf.enabled` field in the response.
|
|
7
|
-
*
|
|
8
|
-
* @returns Object with `isSupported` boolean and `isLoading` state
|
|
9
|
-
*/
|
|
10
|
-
export declare function usePasskeySupport(): {
|
|
11
|
-
isSupported: boolean;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
};
|