@connect-xyz/auth-js 1.52.0 → 1.54.0

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 CHANGED
@@ -69,6 +69,9 @@ const auth = new Auth({
69
69
  onEvent: ({ type, data }) => {
70
70
  console.log('Event received:', type, data);
71
71
  },
72
+ onLoaded: () => {
73
+ console.log('Auth widget loaded and ready');
74
+ },
72
75
  });
73
76
 
74
77
  // Render the widget to a container element
@@ -123,6 +126,7 @@ const auth = new Auth(config);
123
126
  | `onClose` | `() => void` | No | - | Callback when the widget is closed |
124
127
  | `onDeposit` | `({ data }) => void` | No | - | Callback for deposit received |
125
128
  | `onEvent` | `({ type, data }) => void` | No | - | Callback for general events |
129
+ | `onLoaded` | `() => void` | No | - | Callback when the widget is loaded and ready |
126
130
 
127
131
  ### Constructor
128
132
 
@@ -142,6 +146,7 @@ Creates a new Auth instance with the provided configuration.
142
146
  - `onClose` (function, optional): Close callback
143
147
  - `onDeposit` (function, optional): Deposit callback
144
148
  - `onEvent` (function, optional): General event callback
149
+ - `onLoaded` (function, optional): Callback when widget is loaded and ready
145
150
 
146
151
  ### Methods
147
152
 
@@ -237,6 +242,16 @@ onEvent: ({ type, data }) => {
237
242
  };
238
243
  ```
239
244
 
245
+ ### onLoaded
246
+
247
+ Called when the Auth widget has fully loaded and is ready for user interaction. This callback is useful for showing loading states or performing actions once the widget is initialized.
248
+
249
+ ```javascript
250
+ onLoaded: () => {
251
+ // Widget is fully loaded and ready
252
+ };
253
+ ```
254
+
240
255
  ## Browser Support
241
256
 
242
257
  - Chrome/Edge 90+
package/dist/index.d.ts CHANGED
@@ -94,8 +94,6 @@ export default Auth;
94
94
  declare type AuthCallbacks = CommonCallbacks<AuthEvent> & {
95
95
  /** Called when a deposit action occurs */
96
96
  onDeposit?: (deposit: DepositCompletedPayload) => void;
97
- /** Called when the Auth component has finished loading and is ready */
98
- onLoaded?: () => void;
99
97
  };
100
98
 
101
99
  export declare interface AuthConfig extends BaseConfig<AuthEvent>, AuthCallbacks {
@@ -404,6 +402,8 @@ declare type CommonCallbacks<TEvent = AppEvent> = {
404
402
  onClose?: () => void;
405
403
  /** Called when a general event occurs */
406
404
  onEvent?: (event: TEvent) => void;
405
+ /** Called when the widget has loaded and is ready */
406
+ onLoaded?: () => void;
407
407
  };
408
408
 
409
409
  export declare type ConnectAuthElement = SdkElement<AuthConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connect-xyz/auth-js",
3
- "version": "1.52.0",
3
+ "version": "1.54.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",