Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@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
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.