@connect-xyz/auth-react 0.84.10 → 0.84.12
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 +1 -1
- package/dist/index.js +38 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,8 +91,8 @@ For detailed information about callback events and their payloads, see the [Auth
|
|
|
91
91
|
Here's a full example of integrating Connect Auth into your React application:
|
|
92
92
|
|
|
93
93
|
```tsx
|
|
94
|
-
import React from 'react';
|
|
95
94
|
import { Auth } from '@connect-xyz/auth-react';
|
|
95
|
+
import React from 'react';
|
|
96
96
|
|
|
97
97
|
function App() {
|
|
98
98
|
// JWT token should be obtained from your backend
|
package/dist/index.js
CHANGED
|
@@ -231,40 +231,47 @@ var s = {
|
|
|
231
231
|
return E ? (T(E, !1), () => {
|
|
232
232
|
b = !0, C();
|
|
233
233
|
}) : g;
|
|
234
|
+
}, x = {
|
|
235
|
+
local: {
|
|
236
|
+
BASE_URL: "/",
|
|
237
|
+
DEV: !1,
|
|
238
|
+
MODE: "production",
|
|
239
|
+
PROD: !0,
|
|
240
|
+
SSR: !1,
|
|
241
|
+
VITE_ASSETS_SERVICE_URL: "http://localhost:5173/assets",
|
|
242
|
+
VITE_CONNECT_API_BASE_URL: "/api/v1",
|
|
243
|
+
VITE_CONNECT_ENV: "local",
|
|
244
|
+
VITE_CONNECT_SDK_API_BASE_URL: "/sdk/v1",
|
|
245
|
+
VITE_DYNAMIC_ENVIRONMENT_ID: "38ce0330-c85e-414a-80b4-6129c548018f",
|
|
246
|
+
VITE_FARO_COLLECTOR_URL: "https://grafana-faro-collector.dev.0hash.com/collect",
|
|
247
|
+
VITE_FEATURE_SERVER_PROXY_URL: "https://ff-edge.dev.0hash.com/api/frontend",
|
|
248
|
+
VITE_INTERNAL_BUILD: "false",
|
|
249
|
+
VITE_ONBOARDING_API_BASE_URL: "/onboarding",
|
|
250
|
+
VITE_POST_MESSAGE_COMMUNICATION_PLATFORMS: "UW6VWU",
|
|
251
|
+
VITE_REDIRECT_HANDLER_URL: "http://localhost:4202/redirect-handler/index.html",
|
|
252
|
+
VITE_SCRAPER_EXTENSION_ID_CHROMIUM: "kofibejdfkmnbobmbogndbiimkflcllf",
|
|
253
|
+
VITE_TRADE_API_BASE_URL: "/trade",
|
|
254
|
+
VITE_UNLEASH_APIKEY: "zerohash-sdk:dev.b0d8aa594e9b94564f885167881bcb9dc69332f935fcb253e656ff34"
|
|
255
|
+
}.VITE_LOCAL_CDN_HOST || "http://localhost:5173",
|
|
256
|
+
dev: "https://sdk-cdn.dev.0hash.com",
|
|
257
|
+
cert: "https://sdk-cdn.cert.zerohash.com",
|
|
258
|
+
prod: "https://sdk-cdn.zerohash.com",
|
|
259
|
+
"eu-cert": "https://sdk-cdn.cert.zerohash.eu",
|
|
260
|
+
"eu-prod": "https://sdk-cdn.zerohash.eu"
|
|
234
261
|
};
|
|
235
|
-
({
|
|
236
|
-
BASE_URL: "/",
|
|
237
|
-
DEV: !1,
|
|
238
|
-
MODE: "production",
|
|
239
|
-
PROD: !0,
|
|
240
|
-
SSR: !1,
|
|
241
|
-
VITE_ASSETS_SERVICE_URL: "http://localhost:5173/assets",
|
|
242
|
-
VITE_CONNECT_API_BASE_URL: "/api/v1",
|
|
243
|
-
VITE_CONNECT_ENV: "local",
|
|
244
|
-
VITE_CONNECT_SDK_API_BASE_URL: "/sdk/v1",
|
|
245
|
-
VITE_DYNAMIC_ENVIRONMENT_ID: "38ce0330-c85e-414a-80b4-6129c548018f",
|
|
246
|
-
VITE_FARO_COLLECTOR_URL: "https://grafana-faro-collector.dev.0hash.com/collect",
|
|
247
|
-
VITE_FEATURE_SERVER_PROXY_URL: "https://ff-edge.dev.0hash.com/api/frontend",
|
|
248
|
-
VITE_INTERNAL_BUILD: "false",
|
|
249
|
-
VITE_ONBOARDING_API_BASE_URL: "/onboarding",
|
|
250
|
-
VITE_POST_MESSAGE_COMMUNICATION_PLATFORMS: "UW6VWU",
|
|
251
|
-
VITE_REDIRECT_HANDLER_URL: "http://localhost:4202/redirect-handler/index.html",
|
|
252
|
-
VITE_SCRAPER_EXTENSION_ID_CHROMIUM: "kofibejdfkmnbobmbogndbiimkflcllf",
|
|
253
|
-
VITE_TRADE_API_BASE_URL: "/trade",
|
|
254
|
-
VITE_UNLEASH_APIKEY: "zerohash-sdk:dev.b0d8aa594e9b94564f885167881bcb9dc69332f935fcb253e656ff34"
|
|
255
|
-
}).VITE_LOCAL_CDN_HOST, {
|
|
262
|
+
[...Object.entries(x).filter(([e]) => e !== "local").map(([, e]) => e)], {
|
|
256
263
|
LOADED: "travel_rule_loaded",
|
|
257
264
|
COMPLETED: "travel_rule_completed"
|
|
258
265
|
}.LOADED;
|
|
259
266
|
//#endregion
|
|
260
267
|
//#region ../../../common/callbacks/dist/shared/models.js
|
|
261
|
-
var
|
|
268
|
+
var S;
|
|
262
269
|
(function(e) {
|
|
263
270
|
e.NETWORK_ERROR = "network_error", e.AUTH_ERROR = "auth_error", e.NOT_FOUND_ERROR = "not_found_error", e.VALIDATION_ERROR = "validation_error", e.SERVER_ERROR = "server_error", e.CLIENT_ERROR = "client_error", e.UNKNOWN_ERROR = "unknown_error";
|
|
264
|
-
})(
|
|
271
|
+
})(S ||= {});
|
|
265
272
|
//#endregion
|
|
266
273
|
//#region ../../../common/react-sdk-base/dist/use-web-component-script.js
|
|
267
|
-
var
|
|
274
|
+
var C = (e) => {
|
|
268
275
|
let { webComponentTag: t, appName: n, appVersion: a, scriptUrls: s, fallbackScriptUrls: c, collectorUrls: l, env: d, jwt: f, timeoutMs: p } = e, [m, h] = o(!1), [g, _] = o(0);
|
|
269
276
|
return i(() => (h(!1), b({
|
|
270
277
|
webComponentTag: t,
|
|
@@ -292,10 +299,10 @@ var S = (e) => {
|
|
|
292
299
|
loadFailed: m,
|
|
293
300
|
retry: r(() => _((e) => e + 1), [])
|
|
294
301
|
};
|
|
295
|
-
},
|
|
302
|
+
}, w = {
|
|
296
303
|
sandbox: "https://sdk.sandbox.connect.xyz/auth-web/index.js",
|
|
297
304
|
production: "https://sdk.connect.xyz/auth-web/index.js"
|
|
298
|
-
},
|
|
305
|
+
}, T = "connect-auth", E = w, D = ({ jwt: t, env: r = "production", theme: i, onError: o, onClose: s, onDeposit: u, onEvent: d, onLoaded: f, ...p }) => {
|
|
299
306
|
let m = a(null);
|
|
300
307
|
l(m, {
|
|
301
308
|
theme: i,
|
|
@@ -305,16 +312,16 @@ var S = (e) => {
|
|
|
305
312
|
onEvent: d,
|
|
306
313
|
onLoaded: f
|
|
307
314
|
});
|
|
308
|
-
let { loadFailed: h, retry: g } =
|
|
309
|
-
webComponentTag:
|
|
310
|
-
scriptUrls:
|
|
315
|
+
let { loadFailed: h, retry: g } = C({
|
|
316
|
+
webComponentTag: T,
|
|
317
|
+
scriptUrls: E,
|
|
311
318
|
env: r,
|
|
312
319
|
jwt: t
|
|
313
320
|
});
|
|
314
321
|
return h ? /* @__PURE__ */ e(c, {
|
|
315
322
|
onRetry: g,
|
|
316
323
|
onClose: s
|
|
317
|
-
}) : n.createElement(
|
|
324
|
+
}) : n.createElement(T, {
|
|
318
325
|
ref: m,
|
|
319
326
|
jwt: t,
|
|
320
327
|
env: r,
|
|
@@ -323,4 +330,4 @@ var S = (e) => {
|
|
|
323
330
|
});
|
|
324
331
|
};
|
|
325
332
|
//#endregion
|
|
326
|
-
export {
|
|
333
|
+
export { D as Auth };
|