Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@wf-financing/ui-entry

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wf-financing/ui-entry

Wayflyer provides a `@wf-financing/ui-entry` package that can be used as a client-side UI SDK to interact with the Embedded Finance API. It provides a single method to mount the CTA banner in the partner UI.

latest
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Wayflyer Financing UI SDK

Wayflyer provides a @wf-financing/ui-entry package that can be used as a client-side UI SDK to interact with the Embedded Finance API. It provides a single method to mount the CTA banner in the partner UI.

Installation

Install the package directly from NPM with npm install @wf-financing/ui-entry.
To minimize the bundle size and reduce the impact on partners' page load times, the SDK uses dynamic imports to load the main part of the functionality.

Instantiation

To initialize WayflyerUiSdk, call the static method loadSdkMode with the following parameters:

  • targetId - The DOM element's ID where the CTA is supposed to be mounted.
  • partnerDesignId - The ID of the partner theme that needs to be applied to the CTA.
    • Note: The partner must request Wayflyer to generate a special theme ID.
  • partnerCallback - A function of type PartnerCallbackType, which is also provided by the @wf-financing/ui-entry package.
  • companyToken - The merchant identifier.
    • Note: The companyToken should be minted using the Company Token endpoint on the partner's backend. See the Authentication section here for more details.
import { type IWayflyerUiCtaSdk, WayflyerUiSdk } from '@wf-financing/ui-entry';

const wayflyerSdk = (await WayflyerUiSdk.loadSdkMode(targetId, partnerDesignId, partnerCallback, companyToken)) as IWayflyerUiCtaSdk;

SDK methods

mountCta()

This function mounts the CTA banner once it's called.

wayflyerSdk.mountCta();

Mocked mode

To simplify the testing process, the SDK can be initialized in mock mode. To do so, pass a fifth argument of type MockedModeType. In mock mode, the partner can manually set responses for SDK methods via the sdkScenario field in the optional mockedMode argument.

import { WayflyerUiSdk, type MockedModeType, SdkScenarios } from '@wf-financing/ui-entry';

const mockedModeNewApplication: MockedModeType = {
   isMockedMode: true,
   sdkScenario: SdkScenarios.INDICATIVE_NEW_APPLICATION,
};

const mockedModeNewApplication: MockedModeType = {
   isMockedMode: true,
   sdkScenario: SdkScenarios.GENERIC_NEW_APPLICATION,
};

const mockedModeContinueApplication: MockedModeType = {
   isMockedMode: true,
   sdkScenario: SdkScenarios.CONTINUE_APPLICATION,
};

const mockedModeNoCta: MockedModeType = {
   isMockedMode: true,
   sdkScenario: SdkScenarios.NO_CTA,
};

const wayflyerSdk = (await WayflyerUiSdk.loadSdkMode(targetId, partnerDesignId, partnerCallback, companyToken, mockedMode)) as IWayflyerUiCtaSdk;

After instantiation with the mockedMode parameter, the CTA banner will behave according to the specified scenario.

FAQs

Package last updated on 11 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts