@edge-markets/connect-react-native 1.4.1 → 1.4.2
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 +6 -8
- package/dist/index.js +2 -4
- package/dist/index.mjs +6 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -133,9 +133,14 @@ React hook for EdgeLink integration.
|
|
|
133
133
|
| `environment` | `'production' \| 'staging' \| 'sandbox'` | ✅ | Environment |
|
|
134
134
|
| `redirectUri` | `string` | ✅ | Deep link URI for callback |
|
|
135
135
|
| `scopes` | `EdgeScope[]` | ❌ | Requested permissions |
|
|
136
|
-
| `linkUrl` | `string` | ❌ | Custom Link URL (dev only) |
|
|
136
|
+
| `linkUrl` | `string` | ❌ | Custom Link URL/origin (dev only) |
|
|
137
137
|
| `useExternalBrowser` | `boolean` | ❌ | Use external browser |
|
|
138
138
|
|
|
139
|
+
The SDK derives the hosted Link URL from `environment`; staging defaults to
|
|
140
|
+
`https://oauth.staging-app.edgeboost.io/oauth/link`. `linkUrl` is only needed for
|
|
141
|
+
nonstandard deployments. If provided as an origin, for example
|
|
142
|
+
`https://oauth.example.com`, the SDK appends `/oauth/link`.
|
|
143
|
+
|
|
139
144
|
**Returns:**
|
|
140
145
|
| Property | Type | Description |
|
|
141
146
|
|----------|------|-------------|
|
|
@@ -304,10 +309,3 @@ Install and import `react-native-get-random-values` before any crypto operations
|
|
|
304
309
|
|
|
305
310
|
MIT
|
|
306
311
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
package/dist/index.js
CHANGED
|
@@ -60,8 +60,8 @@ module.exports = __toCommonJS(index_exports);
|
|
|
60
60
|
var import_connect2 = require("@edge-markets/connect");
|
|
61
61
|
|
|
62
62
|
// src/edge-link.ts
|
|
63
|
-
var import_react_native = require("react-native");
|
|
64
63
|
var import_connect = require("@edge-markets/connect");
|
|
64
|
+
var import_react_native = require("react-native");
|
|
65
65
|
|
|
66
66
|
// src/pkce.ts
|
|
67
67
|
function hasNativeCrypto() {
|
|
@@ -423,9 +423,7 @@ var EdgeLink = class {
|
|
|
423
423
|
this.cleanup();
|
|
424
424
|
}
|
|
425
425
|
buildLinkUrl() {
|
|
426
|
-
const
|
|
427
|
-
const baseUrl = this.config.linkUrl || `${envConfig.userClientUrl}/oauth/link`;
|
|
428
|
-
const url = new URL(baseUrl);
|
|
426
|
+
const url = new URL((0, import_connect.getLinkUrl)(this.config.environment, this.config.linkUrl));
|
|
429
427
|
const scopes = this.config.scopes || import_connect.ALL_EDGE_SCOPES;
|
|
430
428
|
url.searchParams.set("client_id", this.config.clientId);
|
|
431
429
|
url.searchParams.set("state", this.state);
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
EdgeTokenExchangeError,
|
|
13
13
|
SCOPE_DESCRIPTIONS,
|
|
14
14
|
formatScopesForEnvironment as formatScopesForEnvironment2,
|
|
15
|
-
getEnvironmentConfig
|
|
15
|
+
getEnvironmentConfig,
|
|
16
16
|
isApiError,
|
|
17
17
|
isAuthenticationError,
|
|
18
18
|
isConsentRequiredError,
|
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
} from "@edge-markets/connect";
|
|
21
21
|
|
|
22
22
|
// src/edge-link.ts
|
|
23
|
-
import { Linking, Platform } from "react-native";
|
|
24
23
|
import {
|
|
25
|
-
getEnvironmentConfig,
|
|
26
24
|
ALL_EDGE_SCOPES,
|
|
27
|
-
formatScopesForEnvironment
|
|
25
|
+
formatScopesForEnvironment,
|
|
26
|
+
getLinkUrl
|
|
28
27
|
} from "@edge-markets/connect";
|
|
28
|
+
import { Linking, Platform } from "react-native";
|
|
29
29
|
|
|
30
30
|
// src/pkce.ts
|
|
31
31
|
function hasNativeCrypto() {
|
|
@@ -387,9 +387,7 @@ var EdgeLink = class {
|
|
|
387
387
|
this.cleanup();
|
|
388
388
|
}
|
|
389
389
|
buildLinkUrl() {
|
|
390
|
-
const
|
|
391
|
-
const baseUrl = this.config.linkUrl || `${envConfig.userClientUrl}/oauth/link`;
|
|
392
|
-
const url = new URL(baseUrl);
|
|
390
|
+
const url = new URL(getLinkUrl(this.config.environment, this.config.linkUrl));
|
|
393
391
|
const scopes = this.config.scopes || ALL_EDGE_SCOPES;
|
|
394
392
|
url.searchParams.set("client_id", this.config.clientId);
|
|
395
393
|
url.searchParams.set("state", this.state);
|
|
@@ -675,7 +673,7 @@ export {
|
|
|
675
673
|
formatScopesForEnvironment2 as formatScopesForEnvironment,
|
|
676
674
|
generatePKCE,
|
|
677
675
|
generateState,
|
|
678
|
-
|
|
676
|
+
getEnvironmentConfig,
|
|
679
677
|
isApiError,
|
|
680
678
|
isAuthenticationError,
|
|
681
679
|
isConsentRequiredError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edge-markets/connect-react-native",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "React Native SDK for EDGE Connect authentication flow for mobile apps",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"author": "EdgeBoost",
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@edge-markets/connect": "^1.
|
|
33
|
+
"@edge-markets/connect": "^1.6.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=18.0.0",
|