@dynamic-labs/react-native-extension 3.0.0-alpha.9 → 3.0.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/index.cjs
CHANGED
|
@@ -8,10 +8,11 @@ var messageTransport = require('@dynamic-labs/message-transport');
|
|
|
8
8
|
var logger$1 = require('@dynamic-labs/logger');
|
|
9
9
|
var reactNative = require('react-native');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
-
var expoLinking = require('expo-linking');
|
|
12
11
|
var reactNativePasskeyStamper = require('@turnkey/react-native-passkey-stamper');
|
|
12
|
+
var expoLinking = require('expo-linking');
|
|
13
|
+
var expoWebBrowser = require('expo-web-browser');
|
|
13
14
|
|
|
14
|
-
var version$1 = "3.0.
|
|
15
|
+
var version$1 = "3.0.1";
|
|
15
16
|
|
|
16
17
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
17
18
|
|
|
@@ -2959,25 +2960,6 @@ const setupFetchHandler = core => {
|
|
|
2959
2960
|
}));
|
|
2960
2961
|
};
|
|
2961
2962
|
|
|
2962
|
-
const setupPlatformHandler = core => {
|
|
2963
|
-
const platformChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
2964
|
-
core.manifest.setPlatform('react-native');
|
|
2965
|
-
platformChannel.handle('openURL', url => __awaiter(void 0, void 0, void 0, function* () {
|
|
2966
|
-
yield expoLinking.openURL(url);
|
|
2967
|
-
}));
|
|
2968
|
-
platformChannel.handle('openNewWindow', url => __awaiter(void 0, void 0, void 0, function* () {
|
|
2969
|
-
const error = new Error('openNewWindow message handler not implemented');
|
|
2970
|
-
logger.error(error);
|
|
2971
|
-
core.initialization.error = error;
|
|
2972
|
-
throw error;
|
|
2973
|
-
}));
|
|
2974
|
-
// TODO: this is temporary and should be removed once we are able to get the redirect URL from
|
|
2975
|
-
// dashboard as provided from the customer
|
|
2976
|
-
platformChannel.handle('getRedirectUrl', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
2977
|
-
return expoLinking.createURL('');
|
|
2978
|
-
}));
|
|
2979
|
-
};
|
|
2980
|
-
|
|
2981
2963
|
const setupPasskeyHandler = core => {
|
|
2982
2964
|
const passkeysRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
2983
2965
|
passkeysRequestChannel.handle('createPasskey', _a => __awaiter(void 0, [_a], void 0, function* ({
|
|
@@ -3009,6 +2991,25 @@ const setupPasskeyHandler = core => {
|
|
|
3009
2991
|
}));
|
|
3010
2992
|
};
|
|
3011
2993
|
|
|
2994
|
+
const setupPlatformHandler = core => {
|
|
2995
|
+
const platformChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
2996
|
+
core.manifest.setPlatform('react-native');
|
|
2997
|
+
core.manifest.setRedirectUrl(expoLinking.createURL(''));
|
|
2998
|
+
platformChannel.handle('openURL', url => __awaiter(void 0, void 0, void 0, function* () {
|
|
2999
|
+
yield expoLinking.openURL(url);
|
|
3000
|
+
}));
|
|
3001
|
+
platformChannel.handle('openAuthenticationWindow', _a => __awaiter(void 0, [_a], void 0, function* ({
|
|
3002
|
+
url,
|
|
3003
|
+
redirectUrl
|
|
3004
|
+
}) {
|
|
3005
|
+
const result = yield expoWebBrowser.openAuthSessionAsync(url, redirectUrl);
|
|
3006
|
+
// When not a success, result can only have a type which is a string describing
|
|
3007
|
+
// what happened in a single word.
|
|
3008
|
+
if (result.type !== 'success') throw new Error(result.type);
|
|
3009
|
+
return result.url;
|
|
3010
|
+
}));
|
|
3011
|
+
};
|
|
3012
|
+
|
|
3012
3013
|
const defaultWebviewUrl = `https://webview.dynamicauth.com/${version$1}`;
|
|
3013
3014
|
const ReactNativeExtension = ({
|
|
3014
3015
|
webviewUrl: _webviewUrl = defaultWebviewUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/react-native-extension",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"main": "./index.cjs",
|
|
5
5
|
"module": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -14,15 +14,16 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@dynamic-labs/message-transport": "3.0.0-alpha.9",
|
|
18
|
-
"@dynamic-labs/logger": "3.0.0-alpha.9",
|
|
19
17
|
"@turnkey/react-native-passkey-stamper": "0.2.5",
|
|
20
|
-
"
|
|
18
|
+
"@dynamic-labs/client": "3.0.1",
|
|
19
|
+
"@dynamic-labs/logger": "3.0.1",
|
|
20
|
+
"@dynamic-labs/message-transport": "3.0.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^18.2.0",
|
|
24
|
-
"react-native": "
|
|
24
|
+
"react-native": ">=0.73.6 <0.75.0",
|
|
25
25
|
"react-native-webview": "^13.6.4",
|
|
26
|
-
"
|
|
26
|
+
"expo-linking": "^6.2.2",
|
|
27
|
+
"expo-web-browser": ">=12.0.0 <14.0.0"
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Extension } from '@dynamic-labs/client';
|
|
3
|
-
type ReactNativeExtensionProps = {
|
|
3
|
+
export type ReactNativeExtensionProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The URL to load in the WebView.
|
|
6
6
|
*/
|
|
@@ -20,4 +20,3 @@ export type IReactNativeExtension = {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export declare const ReactNativeExtension: ({ webviewUrl, webviewDebuggingEnabled, appOrigin, }?: ReactNativeExtensionProps) => Extension<IReactNativeExtension>;
|
|
23
|
-
export {};
|