@wf-financing/ui 4.7.0 → 4.7.2

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.
@@ -1 +0,0 @@
1
- export const WAYFLYER_HEADLESS_SDK_ID = 'wayflyer-headless-sdk';
package/src/config/url.ts DELETED
@@ -1 +0,0 @@
1
- export const HEADLESS_SDK_URL = 'https://embedded-finance-frontend.vercel.app/npm/@wf-financing/headless@3';
@@ -1,17 +0,0 @@
1
- import { IWayflyerHeadlessSdk, HeadlessSdkOptions } from '@wf-financing/embedded-types';
2
-
3
- export const initializeHeadlessSdk = (companyToken: string, options?: HeadlessSdkOptions): IWayflyerHeadlessSdk => {
4
- if (!window.WayflyerHeadlessSdk) {
5
- throw new Error('Failed to load WayflyerHeadlessSdk from the script.');
6
- }
7
-
8
- const WayflyerHeadlessSdk = window.WayflyerHeadlessSdk;
9
-
10
- if (options) {
11
- const wayflyerSdk = new WayflyerHeadlessSdk(companyToken, options);
12
-
13
- return wayflyerSdk;
14
- }
15
-
16
- return new WayflyerHeadlessSdk(companyToken);
17
- };
@@ -1,19 +0,0 @@
1
- import { IWayflyerHeadlessSdk, HeadlessSdkOptions } from '@wf-financing/embedded-types';
2
-
3
- import { initializeHeadlessSdk } from './initializeHeadlessSdk';
4
-
5
- export const loadScriptAndInitializeSdk = (
6
- script: HTMLScriptElement,
7
- companyToken: string,
8
- options?: HeadlessSdkOptions,
9
- ): Promise<IWayflyerHeadlessSdk> => {
10
- return new Promise<IWayflyerHeadlessSdk>((resolve, reject) => {
11
- script.onload = () => {
12
- try {
13
- resolve(initializeHeadlessSdk(companyToken, options));
14
- } catch (error) {
15
- reject(error);
16
- }
17
- };
18
- });
19
- };