@bounded-sh/core 0.0.20 → 0.0.21
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/client/config.d.ts +5 -4
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -10,8 +10,8 @@ let clientConfig = {
|
|
|
10
10
|
// User configured settings
|
|
11
11
|
name: '',
|
|
12
12
|
logoUrl: '',
|
|
13
|
-
// Bounded production is the
|
|
14
|
-
//
|
|
13
|
+
// Bounded production is the endpoint default. Apps still choose one explicit
|
|
14
|
+
// auth method at init time. Pass `network: 'bounded-staging'` to target staging.
|
|
15
15
|
network: 'bounded-production',
|
|
16
16
|
wsApiUrl: 'wss://realtime.bounded.sh',
|
|
17
17
|
apiUrl: 'https://realtime.bounded.sh',
|
|
@@ -19,14 +19,15 @@ let clientConfig = {
|
|
|
19
19
|
humanAuthApiUrl: 'https://auth.bounded.sh',
|
|
20
20
|
functionsUrl: 'https://functions.bounded.sh',
|
|
21
21
|
appId: '',
|
|
22
|
-
//
|
|
23
|
-
// for
|
|
22
|
+
// No hidden auth fallback: browser clients must pass authMethod explicitly
|
|
23
|
+
// (for example 'email', 'guest', 'phantom', 'privy', or 'privy-expo').
|
|
24
|
+
// Hosted OAuth/social uses loginWithRedirect/loginWithPopup with authMethod:'email'.
|
|
24
25
|
// Text OTP is off by default and uses hosted/headless text helpers only when
|
|
25
26
|
// Bounded explicitly enables it for the issuer. For
|
|
26
27
|
// crypto/onchain wallet login use authMethod:'phantom' (Solana / Phantom), or
|
|
27
28
|
// signInAnonymously() for zero-friction 'guest' accounts. ('wallet' is an
|
|
28
29
|
// unimplemented stub; don't use.)
|
|
29
|
-
authMethod: '
|
|
30
|
+
authMethod: 'none',
|
|
30
31
|
chain: '',
|
|
31
32
|
rpcUrl: '',
|
|
32
33
|
skipBackendInit: true,
|
|
@@ -92,10 +93,14 @@ function init(newConfig) {
|
|
|
92
93
|
}
|
|
93
94
|
// Bounded is client-driven: defaults are Bounded production, `network`
|
|
94
95
|
// switches the whole endpoint set (e.g. 'bounded-staging'), and anything
|
|
95
|
-
// passed explicitly wins. No `/config` round-trip
|
|
96
|
-
//
|
|
96
|
+
// passed explicitly wins. No `/config` round-trip; browser SDKs still pass
|
|
97
|
+
// one explicit authMethod so there is no hidden auth-provider fallback.
|
|
97
98
|
// defaults (bounded-production) < network preset < explicit newConfig
|
|
98
|
-
|
|
99
|
+
if (newConfig.network !== undefined && !(newConfig.network in BOUNDED_NETWORKS)) {
|
|
100
|
+
reject(new Error(`Unsupported Bounded network "${String(newConfig.network)}". Expected bounded, bounded-staging, or bounded-production.`));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const preset = newConfig.network ? BOUNDED_NETWORKS[newConfig.network] : {};
|
|
99
104
|
clientConfig = Object.assign(Object.assign(Object.assign({}, clientConfig), preset), newConfig);
|
|
100
105
|
isInitialized = true;
|
|
101
106
|
resolve();
|