@avalabs/avacloud-waas-react 1.3.0 → 1.3.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.
Files changed (75) hide show
  1. package/README.md +24 -1
  2. package/dist/index.d.mts +2 -1
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.js +18 -1
  5. package/dist/index.mjs +18 -1
  6. package/package.json +1 -1
  7. package/dist/_esm-QWLX263D.mjs +0 -3919
  8. package/dist/ccip-ZGPV4OUI.mjs +0 -14
  9. package/dist/chunk-CASSC3OP.mjs +0 -67
  10. package/dist/chunk-G3BBITEG.mjs +0 -367
  11. package/dist/chunk-H4SP2TEB.mjs +0 -2343
  12. package/dist/chunk-TMRHATUE.mjs +0 -5868
  13. package/dist/dejavu-mono-latin-400-normal-IE7EMRRJ.woff2 +0 -0
  14. package/dist/dejavu-mono-latin-400-normal-MXASKUMG.woff +0 -0
  15. package/dist/dejavu-mono-latin-700-normal-4E6K55SY.woff +0 -0
  16. package/dist/dejavu-mono-latin-700-normal-4R4GZIXF.woff2 +0 -0
  17. package/dist/index.css +0 -473
  18. package/dist/inter-cyrillic-400-normal-KFLOZ6L3.woff2 +0 -0
  19. package/dist/inter-cyrillic-400-normal-UGV3X2ZX.woff +0 -0
  20. package/dist/inter-cyrillic-500-normal-5QURBI26.woff +0 -0
  21. package/dist/inter-cyrillic-500-normal-MRQZIV3H.woff2 +0 -0
  22. package/dist/inter-cyrillic-600-normal-EDUIRGIU.woff +0 -0
  23. package/dist/inter-cyrillic-600-normal-VQSXM56D.woff2 +0 -0
  24. package/dist/inter-cyrillic-700-normal-6AC775OW.woff2 +0 -0
  25. package/dist/inter-cyrillic-700-normal-D4IEZ3GW.woff +0 -0
  26. package/dist/inter-cyrillic-ext-400-normal-JB453SGZ.woff2 +0 -0
  27. package/dist/inter-cyrillic-ext-400-normal-UT7C7CGZ.woff +0 -0
  28. package/dist/inter-cyrillic-ext-500-normal-JTQKN4HY.woff2 +0 -0
  29. package/dist/inter-cyrillic-ext-500-normal-WLOKRQXN.woff +0 -0
  30. package/dist/inter-cyrillic-ext-600-normal-EFECVKGZ.woff2 +0 -0
  31. package/dist/inter-cyrillic-ext-600-normal-NBG3W4IU.woff +0 -0
  32. package/dist/inter-cyrillic-ext-700-normal-4PBXEWDR.woff +0 -0
  33. package/dist/inter-cyrillic-ext-700-normal-SJP7DRTO.woff2 +0 -0
  34. package/dist/inter-greek-400-normal-7Y67TOYM.woff +0 -0
  35. package/dist/inter-greek-400-normal-BRMJUT6T.woff2 +0 -0
  36. package/dist/inter-greek-500-normal-LCPH243Y.woff +0 -0
  37. package/dist/inter-greek-500-normal-PQX5SJVP.woff2 +0 -0
  38. package/dist/inter-greek-600-normal-PKJBTQPQ.woff2 +0 -0
  39. package/dist/inter-greek-600-normal-UPKYUUFH.woff +0 -0
  40. package/dist/inter-greek-700-normal-5N2Y4K7P.woff2 +0 -0
  41. package/dist/inter-greek-700-normal-OE26ANW4.woff +0 -0
  42. package/dist/inter-greek-ext-400-normal-4HYCVGMS.woff +0 -0
  43. package/dist/inter-greek-ext-400-normal-QIS4ONLW.woff2 +0 -0
  44. package/dist/inter-greek-ext-500-normal-AOIZUIP4.woff +0 -0
  45. package/dist/inter-greek-ext-500-normal-Z2CEJP2K.woff2 +0 -0
  46. package/dist/inter-greek-ext-600-normal-FQPCNDF3.woff +0 -0
  47. package/dist/inter-greek-ext-600-normal-KM6XRHAQ.woff2 +0 -0
  48. package/dist/inter-greek-ext-700-normal-FDEUQJ34.woff +0 -0
  49. package/dist/inter-greek-ext-700-normal-LWL55ZDD.woff2 +0 -0
  50. package/dist/inter-latin-400-normal-O6KIPRV2.woff +0 -0
  51. package/dist/inter-latin-400-normal-VQ3UBCDI.woff2 +0 -0
  52. package/dist/inter-latin-500-normal-OD7WVACW.woff +0 -0
  53. package/dist/inter-latin-500-normal-PUEXTTCT.woff2 +0 -0
  54. package/dist/inter-latin-600-normal-5WVF6G4B.woff +0 -0
  55. package/dist/inter-latin-600-normal-GQRH5MIF.woff2 +0 -0
  56. package/dist/inter-latin-700-normal-5OESYTDS.woff2 +0 -0
  57. package/dist/inter-latin-700-normal-ZQVBARDV.woff +0 -0
  58. package/dist/inter-latin-ext-400-normal-BTAMM2KL.woff2 +0 -0
  59. package/dist/inter-latin-ext-400-normal-YUALTDTA.woff +0 -0
  60. package/dist/inter-latin-ext-500-normal-DV5RJSXI.woff2 +0 -0
  61. package/dist/inter-latin-ext-500-normal-KJKTVLML.woff +0 -0
  62. package/dist/inter-latin-ext-600-normal-AOYWYIP3.woff2 +0 -0
  63. package/dist/inter-latin-ext-600-normal-L5SWE5DY.woff +0 -0
  64. package/dist/inter-latin-ext-700-normal-2RDPBVFQ.woff2 +0 -0
  65. package/dist/inter-latin-ext-700-normal-XQIRBHUR.woff +0 -0
  66. package/dist/inter-vietnamese-400-normal-724F3VTF.woff +0 -0
  67. package/dist/inter-vietnamese-400-normal-KH5NGGJJ.woff2 +0 -0
  68. package/dist/inter-vietnamese-500-normal-F77QXW2X.woff2 +0 -0
  69. package/dist/inter-vietnamese-500-normal-ZTDWBSHR.woff +0 -0
  70. package/dist/inter-vietnamese-600-normal-47DK6MCQ.woff2 +0 -0
  71. package/dist/inter-vietnamese-600-normal-M4XR4C4S.woff +0 -0
  72. package/dist/inter-vietnamese-700-normal-ONTG3SOY.woff +0 -0
  73. package/dist/inter-vietnamese-700-normal-T2WXKRNY.woff2 +0 -0
  74. package/dist/mod-LKCIPMBZ.mjs +0 -2628
  75. package/dist/secp256k1-AYCAE7S6.mjs +0 -16
package/README.md CHANGED
@@ -89,13 +89,36 @@ The main provider component that wraps your application and provides wallet cont
89
89
  | Prop | Type | Description |
90
90
  |------|------|-------------|
91
91
  | `orgId` | `string` | **Required** - Your AvaCloud organization ID used to fetch wallet configuration |
92
- | `env` | `'local' \| 'development' \| 'prod'` | Environment to use (default: `'prod'`) |
92
+ | `env` | `'development' \| 'staging' \| 'production'` | Environment to use (default: `'production'`) |
93
93
  | `chainId` | `number` | EVM chain ID (default: `43113` - Avalanche Fuji Testnet) |
94
94
  | `darkMode` | `boolean` | Enable dark mode for UI components (default: `false`) |
95
+ | `authServiceUrl` | `string` | Optional custom auth service URL. Overrides default environment-based URLs |
95
96
  | `onAuthSuccess` | `(user: Auth0User) => void` | Callback on successful authentication |
96
97
  | `onAuthError` | `(error: Error) => void` | Callback on authentication error |
97
98
  | `onWalletUpdate` | `(wallet: WalletInfo) => void` | Callback when wallet information updates |
98
99
 
100
+ #### Configuring Auth Service URL
101
+
102
+ The auth service URL can be configured in three ways (in order of precedence):
103
+
104
+ 1. **Direct prop**: Pass `authServiceUrl` directly to the provider
105
+ ```tsx
106
+ <AvaCloudWalletProvider
107
+ orgId="your-org-id"
108
+ authServiceUrl="https://your-custom-auth-service.com"
109
+ >
110
+ ```
111
+
112
+ 2. **Environment variable**: Set `NEXT_PUBLIC_AUTH_SERVICE_URL` in your `.env` file
113
+ ```bash
114
+ NEXT_PUBLIC_AUTH_SERVICE_URL=https://your-custom-auth-service.com
115
+ ```
116
+
117
+ 3. **Default URLs**: Falls back to environment-based defaults
118
+ - `development`: `http://localhost:3000`
119
+ - `staging`: `https://ac-auth-service-env-staging-ava-labs.vercel.app`
120
+ - `production`: `https://ac-auth-service.vercel.app`
121
+
99
122
  ### UI Components
100
123
 
101
124
  - `LoginButton`: Button component for initiating the login flow
package/dist/index.d.mts CHANGED
@@ -295,6 +295,7 @@ interface AvaCloudWalletProviderProps {
295
295
  chainId?: number;
296
296
  darkMode?: boolean;
297
297
  env?: AvaCloudEnvironment;
298
+ authServiceUrl?: string;
298
299
  onAuthSuccess?: (user: UserInfo) => void;
299
300
  onAuthError?: (error: Error) => void;
300
301
  onWalletUpdate?: (wallet: WalletInfo) => void;
@@ -322,7 +323,7 @@ interface AvaCloudWalletContextType {
322
323
  environment: AvaCloudEnvironment;
323
324
  }
324
325
 
325
- declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
326
+ declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, authServiceUrl: customAuthServiceUrl, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
326
327
  declare function useAvaCloudWallet(): AvaCloudWalletContextType;
327
328
 
328
329
  interface ThemeContextType {
package/dist/index.d.ts CHANGED
@@ -295,6 +295,7 @@ interface AvaCloudWalletProviderProps {
295
295
  chainId?: number;
296
296
  darkMode?: boolean;
297
297
  env?: AvaCloudEnvironment;
298
+ authServiceUrl?: string;
298
299
  onAuthSuccess?: (user: UserInfo) => void;
299
300
  onAuthError?: (error: Error) => void;
300
301
  onWalletUpdate?: (wallet: WalletInfo) => void;
@@ -322,7 +323,7 @@ interface AvaCloudWalletContextType {
322
323
  environment: AvaCloudEnvironment;
323
324
  }
324
325
 
325
- declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
326
+ declare function AvaCloudWalletProvider({ children, orgId, chainId, darkMode, env, authServiceUrl: customAuthServiceUrl, onAuthSuccess, onAuthError, onWalletUpdate, }: AvaCloudWalletProviderProps): react_jsx_runtime.JSX.Element;
326
327
  declare function useAvaCloudWallet(): AvaCloudWalletContextType;
327
328
 
328
329
  interface ThemeContextType {
package/dist/index.js CHANGED
@@ -1638,6 +1638,7 @@ function AvaCloudWalletProvider({
1638
1638
  chainId = 43113,
1639
1639
  darkMode = false,
1640
1640
  env = "production",
1641
+ authServiceUrl: customAuthServiceUrl,
1641
1642
  onAuthSuccess,
1642
1643
  onAuthError,
1643
1644
  onWalletUpdate
@@ -1646,7 +1647,23 @@ function AvaCloudWalletProvider({
1646
1647
  (0, import_react9.useEffect)(() => {
1647
1648
  setChainId(chainId);
1648
1649
  }, [chainId, setChainId]);
1649
- const authServiceUrl = env === "development" ? "http://localhost:3000" : env === "staging" ? "https://ac-auth-service-env-staging-ava-labs.vercel.app" : "https://ac-auth-service.vercel.app";
1650
+ const getAuthServiceUrl = () => {
1651
+ var _a;
1652
+ if (customAuthServiceUrl) {
1653
+ return customAuthServiceUrl;
1654
+ }
1655
+ if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.NEXT_PUBLIC_AUTH_SERVICE_URL)) {
1656
+ return process.env.NEXT_PUBLIC_AUTH_SERVICE_URL;
1657
+ }
1658
+ if (env === "development") {
1659
+ return "http://localhost:3000";
1660
+ } else if (env === "staging") {
1661
+ return "https://ac-auth-service-env-staging-ava-labs.vercel.app";
1662
+ } else {
1663
+ return "https://ac-auth-service.vercel.app";
1664
+ }
1665
+ };
1666
+ const authServiceUrl = getAuthServiceUrl();
1650
1667
  const environment = env;
1651
1668
  const [isAuthenticated, setIsAuthenticated] = (0, import_react9.useState)(false);
1652
1669
  const [isCubistLoading, setIsCubistLoading] = (0, import_react9.useState)(true);
package/dist/index.mjs CHANGED
@@ -1577,6 +1577,7 @@ function AvaCloudWalletProvider({
1577
1577
  chainId = 43113,
1578
1578
  darkMode = false,
1579
1579
  env = "production",
1580
+ authServiceUrl: customAuthServiceUrl,
1580
1581
  onAuthSuccess,
1581
1582
  onAuthError,
1582
1583
  onWalletUpdate
@@ -1585,7 +1586,23 @@ function AvaCloudWalletProvider({
1585
1586
  useEffect5(() => {
1586
1587
  setChainId(chainId);
1587
1588
  }, [chainId, setChainId]);
1588
- const authServiceUrl = env === "development" ? "http://localhost:3000" : env === "staging" ? "https://ac-auth-service-env-staging-ava-labs.vercel.app" : "https://ac-auth-service.vercel.app";
1589
+ const getAuthServiceUrl = () => {
1590
+ var _a;
1591
+ if (customAuthServiceUrl) {
1592
+ return customAuthServiceUrl;
1593
+ }
1594
+ if (typeof process !== "undefined" && ((_a = process.env) == null ? void 0 : _a.NEXT_PUBLIC_AUTH_SERVICE_URL)) {
1595
+ return process.env.NEXT_PUBLIC_AUTH_SERVICE_URL;
1596
+ }
1597
+ if (env === "development") {
1598
+ return "http://localhost:3000";
1599
+ } else if (env === "staging") {
1600
+ return "https://ac-auth-service-env-staging-ava-labs.vercel.app";
1601
+ } else {
1602
+ return "https://ac-auth-service.vercel.app";
1603
+ }
1604
+ };
1605
+ const authServiceUrl = getAuthServiceUrl();
1589
1606
  const environment = env;
1590
1607
  const [isAuthenticated, setIsAuthenticated] = useState7(false);
1591
1608
  const [isCubistLoading, setIsCubistLoading] = useState7(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/avacloud-waas-react",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "React SDK for AvaCloud Wallet as a Service",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",