Install, initialize and configure iBranch on the frontend
Initialization API
Following are the complete input and response schema for lendica.init(initCredentials, initConfig)
function.
Init input schema
Param | Key | Value type | Default value | Required | Explanation |
---|---|---|---|---|---|
initCredentials | company_name | String | n/a | true | Company account name of your client. |
partner_company_uuid | String | n/a | true | Company account id of your client. | |
partner_name | String | n/a | true | Your platform's name defined on our backend. | |
initConfig | showSideButton | Boolean | true | false | Option to hide the side button on the right edge of the screen. |
buttonPositionPercentage | Number | 50 | false | Side button position percentage to the top, relative to the window height. |
Init response schema
// These are available for all statuses including error.
{
status: "string",
message: "string"
}
Example:
// Check if Lendica auth is successful before proceeding with rendering UI
lendica.init(credentials, config).then(({ status, message }) => {
if (status === "success") {
lendica.ibranch.render();
}
}).catch(error => {
console.log(error.status, error.message);
});
Init response statuses and messages
Status | Message | Details |
---|---|---|
success | Successfully initialized with credentials. | Returned when authenticated successfully with given credentials |
error | This will be the error occurred during auth. | Returned when error occurred during the authentication. |
waitlist | No credentials provided | Returned when no credentials were provided. |
UI Config
Side button settings
The Side Button is the default method by which the customer opens the iBranch.
To adjust the position of the Side Button, set the buttonPositionPercentage to your preferred relative window height. The default is 50 which is at the center.
In some cases, our partners opt to customize the Side Button by building their own component or even completely removing the side button and including a lending menu item or callout. Examples of these customizations can be found below.
To customize the Side Button, set the showSideButton to false. You can then build your own component or menu item and simple call lendica.ibranch.open() to launch the iBranch.
Example - Configure side button position
// Optional config
const config = {
buttonPositionPercentage: 30, // This will put the side button at the 30% of the window height, default is 50%
};
lendica.init(credentials, config).then(({ status, message }) => {
if (status === "success") {
lendica.ibranch.render();
}
});
Example - Hide side button and open iBranch programmatically
const config = {
showSideButton: false, // Option to hide the side button to open iBranch, default to true
};
lendica.init(credentials, config).then(({ status, message }) => {
if (status === "success") {
lendica.ibranch.render();
}
});
// ...on custom buttons or links, provide onClick function to open Lendica iBranch
lendica.ibranch.open(); // See next page for the iBranch API triggers documentation.