@melio-eng/web-sdk 1.0.30-pr.58.aa054e9 → 1.0.31-pr.59.3147594

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.
@@ -123,6 +123,7 @@ export class Flow {
123
123
  }
124
124
  this.eventListeners.get(event).add(callback);
125
125
  }
126
+ /* eslint-enable no-dupe-class-members */
126
127
  /**
127
128
  * Remove an event listener
128
129
  */
@@ -18,7 +18,7 @@ export class OnboardingFlow extends Flow {
18
18
  * Construct the specific flow URL for onboarding - now goes through /auth
19
19
  */
20
20
  constructFlowUrl(baseUrl) {
21
- const params = Object.fromEntries(Object.entries(this.preFilledParams).filter(([_, v]) => v !== undefined));
21
+ const params = Object.fromEntries(Object.entries(this.preFilledParams).filter(([, v]) => v !== undefined));
22
22
  let preFilledBase64 = '';
23
23
  if (Object.keys(params).length > 0) {
24
24
  try {
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export declare class MelioSDK implements MelioSDK {
8
8
  private partnerName;
9
9
  private branchOverride;
10
10
  private authCode;
11
+ private initFlow;
11
12
  constructor();
12
13
  /**
13
14
  * Initialize the SDK - triggers auth event without creating iframe
package/dist/index.js CHANGED
@@ -9,11 +9,16 @@ export class MelioSDK {
9
9
  this.partnerName = '';
10
10
  this.branchOverride = undefined;
11
11
  this.authCode = '';
12
+ this.initFlow = null;
12
13
  }
13
14
  /**
14
15
  * Initialize the SDK - triggers auth event without creating iframe
15
16
  */
16
17
  init(authenticationCode, options) {
18
+ if (this.initFlow) {
19
+ console.log('SDK already initialized. Returning existing init flow instance.');
20
+ return this.initFlow;
21
+ }
17
22
  this.partnerName = options.partnerName;
18
23
  this.environment = options.environment || 'production';
19
24
  this.branchOverride = options.branchOverride;
@@ -28,7 +33,8 @@ export class MelioSDK {
28
33
  console.log('InitFlow initialized successfully');
29
34
  if (options.keepAlive)
30
35
  initFlow.setupKeepAlive();
31
- return initFlow;
36
+ this.initFlow = initFlow;
37
+ return this.initFlow;
32
38
  }
33
39
  /**
34
40
  * Launch the onboarding flow
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melio-eng/web-sdk",
3
- "version": "1.0.30-pr.58.aa054e9",
3
+ "version": "1.0.31-pr.59.3147594",
4
4
  "description": "Melio Web SDK - Embed core Melio workflows directly into partner UI with minimal effort",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",