Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@lendi/lendi-lead-library
Advanced tools
import LendiLeads from '@lendi/lendi-leads-library';
Once you have the data, it must first be set in sessionStorage:
// See below for valid funnel names.
import LendiLeads from "@lendi/lendi-lead-library";
const L3 = new LendiLeads(funnelName);
// Put your funnel data in here as a valid funnel object for leads service to consume
L3.set(data);
// We have some special optional keys that make it easier for other frontends to read the L3 data
L3.setFirstName('test_first_name');
L3.setMobileNumber('test_mobile_number');
L3.setEmail('test_email');
Valid funnel names are: 'BORROWING_POWER', 'NEW_HOME_LOAN', 'REFINANCE', 'BLOG', 'PROPERTY_REPORT', 'STAMP_DUTY_CALCULATOR', 'APPOINTMENT_BOOKING', 'SIGN_UP' and 'INVITE'.
The data should be in a format that the API is expecting, there is no typescript validation on your input. However since the @lendi/lead-client is a peerDependency, the data should correspond to the funnelName using one of the following types:
After the data has been saved it will automatically be found and pulled from storage in lala-customer-app.
Once data gathered, use:
// This should be a reference to the environment
// base URL as L3 will remain unaware.
const baseURL = process.env.API_URL;
LendiLeads.sendLead(data: LeadsRecord, baseURL: string);
This method expects that the data has been formatted in a way that is expected for the leads endpoint.
Note that there will be no types to validate the payload, this contract is between the consuming app and the API. The interface for a leads record is:
interface LeadsRecord {
generatedAt: string;
timeZone: string;
mobileNumber: string;
firstName: string;
origin: LeadsRecordOriginEnum;
brand: LeadsRecordBrandEnum;
accountOrigin: string;
data?: FunnelDataV1 | BorrowingPowerDataV1 | StampDutyDataV1 | PropertyReportDataV1;
email?: string;
gclId?: string;
utm?: string;
}
When constructing this object, there are several helper methods available
LendiLeads.retrieveGCLID();
LendiLeads.retrieveAccountOrigin();
new Date().toISOString();
Intl.DateTimeFormat().resolvedOptions().timeZone;
Some leads data can be consumed statically by front end applications. They have access to firstName, mobileNumber, and email if they have been previously set. To use them do this:
import LendiLeads from '@lendi/lendi-lead-library';
const firstName: string | undefined = LendiLeads.firstName;
const mobileNumber: string | undefined = LendiLeads.mobileNumber;
const email: string | undefined = LendiLeads.email;
In the case of Lendi-app, this library contains several transformation methods to translate the query string data into a format that is required by the core team's leads service. The main transformation method is named:
LendiLeads.transform_DEPRECATED(queryData: { [key: string]: string }, phoneNumber: string)
The queryData should be exactly what was received from the end of the funnel. phoneNumber
is a separate parameter as this is collected in a separate stage (e.g. inside lala-customer-app
).
Under the hood, this will call either a .transformFunnel_DEPRECATED()
or .transformBorrowing_DEPRECATED()
if the data came from either of the funnels (new home loan or refinance) or the borrowing power calculator.
Once this data has been returned, there is a corresponding method: LendiLeads.send_DEPRECATED(data: OldFunnel, brand: LeadsRecordBrandEnum, baseURL: string)
For the parameters:
data
can be passed through directly from the transformation
method.brand
can be passed through as a value on the enum Brand
which is exported from this library: import { Brand } from '@lendi/lendi-lead-library'
baseURL
should be the base url of the API for the current environment, the library will append /v1/leads
to the end of that URL.NOTE: the reason these methods have been marked as _DEPRECATED is because once lendi-app is retired, the methods should never have a use again and the library should take more responsibility for the sending of leads data.
The majority of the types required will be in the package @lendi/lead-client
as they are created from the generated client using the core team's openapi.yaml
swagger doc.
FAQs
Support green call files through funnels
The npm package @lendi/lendi-lead-library receives a total of 46 weekly downloads. As such, @lendi/lendi-lead-library popularity was classified as not popular.
We found that @lendi/lendi-lead-library demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 74 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.