@moon-x/react-native-sdk 0.4.0 → 0.6.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/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +4 -3
- package/dist/index.mjs +4 -3
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -62,8 +62,14 @@ interface RNAuthSDK {
|
|
|
62
62
|
* over JWKS to gate high-risk routes. Must be invoked synchronously
|
|
63
63
|
* from a press handler — WebAuthn requires transient activation.
|
|
64
64
|
* Throws if the user has no enrolled passkey or cancels the prompt.
|
|
65
|
+
*
|
|
66
|
+
* Pass `expiresInSecs` to request a custom token lifetime. Omitted
|
|
67
|
+
* uses the server default (5 min); the server caps it at 1 h and
|
|
68
|
+
* rejects larger values.
|
|
65
69
|
*/
|
|
66
|
-
getPresenceToken: (
|
|
70
|
+
getPresenceToken: (options?: {
|
|
71
|
+
expiresInSecs?: number;
|
|
72
|
+
}) => Promise<{
|
|
67
73
|
presenceToken: string;
|
|
68
74
|
expiresAt: number;
|
|
69
75
|
}>;
|
|
@@ -103,6 +109,7 @@ interface RNAuthSDK {
|
|
|
103
109
|
displayName?: string;
|
|
104
110
|
}) => Promise<{
|
|
105
111
|
credential_id: string;
|
|
112
|
+
passkey_registered: true;
|
|
106
113
|
}>;
|
|
107
114
|
signEthereumMessageHeadless: (params: EthereumSignMessageParams) => Promise<EthereumSignMessageResult>;
|
|
108
115
|
signEthereumTransactionHeadless: (params: EthereumSignTransactionParams) => Promise<EthereumSignTransactionResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -62,8 +62,14 @@ interface RNAuthSDK {
|
|
|
62
62
|
* over JWKS to gate high-risk routes. Must be invoked synchronously
|
|
63
63
|
* from a press handler — WebAuthn requires transient activation.
|
|
64
64
|
* Throws if the user has no enrolled passkey or cancels the prompt.
|
|
65
|
+
*
|
|
66
|
+
* Pass `expiresInSecs` to request a custom token lifetime. Omitted
|
|
67
|
+
* uses the server default (5 min); the server caps it at 1 h and
|
|
68
|
+
* rejects larger values.
|
|
65
69
|
*/
|
|
66
|
-
getPresenceToken: (
|
|
70
|
+
getPresenceToken: (options?: {
|
|
71
|
+
expiresInSecs?: number;
|
|
72
|
+
}) => Promise<{
|
|
67
73
|
presenceToken: string;
|
|
68
74
|
expiresAt: number;
|
|
69
75
|
}>;
|
|
@@ -103,6 +109,7 @@ interface RNAuthSDK {
|
|
|
103
109
|
displayName?: string;
|
|
104
110
|
}) => Promise<{
|
|
105
111
|
credential_id: string;
|
|
112
|
+
passkey_registered: true;
|
|
106
113
|
}>;
|
|
107
114
|
signEthereumMessageHeadless: (params: EthereumSignMessageParams) => Promise<EthereumSignMessageResult>;
|
|
108
115
|
signEthereumTransactionHeadless: (params: EthereumSignTransactionParams) => Promise<EthereumSignTransactionResult>;
|
package/dist/index.js
CHANGED
|
@@ -250,7 +250,7 @@ var getPasskeyMethods = (bridge, publishableKey) => ({
|
|
|
250
250
|
}
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
|
-
return { credential_id: credential.rawId };
|
|
253
|
+
return { credential_id: credential.rawId, passkey_registered: true };
|
|
254
254
|
},
|
|
255
255
|
// Parent-side passkey step-up. Mirrors the web SDK's
|
|
256
256
|
// `sdk.getPresenceToken()` — orchestrator is platform-agnostic; only
|
|
@@ -265,7 +265,7 @@ var getPasskeyMethods = (bridge, publishableKey) => ({
|
|
|
265
265
|
// app's configured rp_id (fetched via the iframe's GET_DEK_INFO) —
|
|
266
266
|
// RN has no window.location.origin to use. Same pattern as
|
|
267
267
|
// sdk-passkey-methods.ts::registerPasskey.
|
|
268
|
-
getPresenceToken: async () => {
|
|
268
|
+
getPresenceToken: async (options) => {
|
|
269
269
|
const dekInfo = await bridge.send(
|
|
270
270
|
import_utils.PostMessageType.AUTH,
|
|
271
271
|
import_utils.PostMessageMethod.GET_DEK_INFO,
|
|
@@ -278,7 +278,8 @@ var getPasskeyMethods = (bridge, publishableKey) => ({
|
|
|
278
278
|
transport: bridge,
|
|
279
279
|
passkey: createRNPasskey(),
|
|
280
280
|
publishableKey,
|
|
281
|
-
relyingPartyOrigin: `https://${dekInfo.rp_id}
|
|
281
|
+
relyingPartyOrigin: `https://${dekInfo.rp_id}`,
|
|
282
|
+
expiresInSecs: options?.expiresInSecs
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -217,7 +217,7 @@ var getPasskeyMethods = (bridge, publishableKey) => ({
|
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
return { credential_id: credential.rawId };
|
|
220
|
+
return { credential_id: credential.rawId, passkey_registered: true };
|
|
221
221
|
},
|
|
222
222
|
// Parent-side passkey step-up. Mirrors the web SDK's
|
|
223
223
|
// `sdk.getPresenceToken()` — orchestrator is platform-agnostic; only
|
|
@@ -232,7 +232,7 @@ var getPasskeyMethods = (bridge, publishableKey) => ({
|
|
|
232
232
|
// app's configured rp_id (fetched via the iframe's GET_DEK_INFO) —
|
|
233
233
|
// RN has no window.location.origin to use. Same pattern as
|
|
234
234
|
// sdk-passkey-methods.ts::registerPasskey.
|
|
235
|
-
getPresenceToken: async () => {
|
|
235
|
+
getPresenceToken: async (options) => {
|
|
236
236
|
const dekInfo = await bridge.send(
|
|
237
237
|
PostMessageType.AUTH,
|
|
238
238
|
PostMessageMethod.GET_DEK_INFO,
|
|
@@ -245,7 +245,8 @@ var getPasskeyMethods = (bridge, publishableKey) => ({
|
|
|
245
245
|
transport: bridge,
|
|
246
246
|
passkey: createRNPasskey(),
|
|
247
247
|
publishableKey,
|
|
248
|
-
relyingPartyOrigin: `https://${dekInfo.rp_id}
|
|
248
|
+
relyingPartyOrigin: `https://${dekInfo.rp_id}`,
|
|
249
|
+
expiresInSecs: options?.expiresInSecs
|
|
249
250
|
});
|
|
250
251
|
}
|
|
251
252
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moon-x/react-native-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "MoonX React Native SDK — WebView-backed transport, react-native-passkeys, AsyncStorage. Mobile parity with @moon-x/react-sdk + @moon-x/core-sdk.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typescript": "5.9.3"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@moon-x/core": "0.
|
|
52
|
+
"@moon-x/core": "0.8.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@expo/config-plugins": ">=10.0.0",
|