Welcome to the Debt Relief React Native SDK Integration Guide
This guide walks you through the process of integrating the Debt Relief SDK into your React Native application. By using this SDK, you can easily connect to Engine by MoneyLion’s financial network, authenticate with the Engine API, and give your users access to personalized Debt Relief offers.
Getting Started
Step 1: Request an API token
Before you can use the Debt Relief Engine SDK, you’ll need to request a new API token from your Partner Manager. This is used to authenticate with the Engine API and provides access to different financial institutions. You may want to use multiple API tokens depending on how many entry points your app has into the SDK.
Step 2: Software Requirements
Platform Requirements
React Native >= 0.71.0
Node JS >= 18
React >= 18.0.0
Peer Dependencies
Please note that react, react-native and @react-native-async-storage/async-storage are peer dependencies, meaning that you should ensure they are installed before installing the SDK.
Package Size:
SDK Bundle Size: 1.99 MB (unpacked)
Step 3: Install the SDK
Install the SDK using your preferred package manager:
npm
npm i @moneylion/react-native-debt-relief-sdk @react-native-async-storage/async-storage
You can import the EngineSDK component into your app. At a minimum, you must provide the API token obtained in Step 1 (requesting a token from your Partner Manager) via the bearerToken prop, and pass the user's first name, last name, and email, as the Engine SDK does not request these three fields. For the full list of supported props, please refer to the Props section.
Here is a screenshot of a sample code snippet of how you might implement the Engine SDK into your app:
For your convenience, the same code snippet is pasted below as text, so you can copy-paste the bulk of the code. Please wrap the following snippet in a self closing < and />, following the screenshot above (the text below omits the wrapping </> so as not to trigger a CSS attack warning on this page).
How it Works
Customization
You can customize the branding by changing the primary and secondary colors to match your own brand. use the ‘primaryColor’ and ‘secondaryColor’ attributes to accomplish this.
Implementation/Prefilled Data
There are certain fields that must be provided to the Engine SDK component on initialization:
Bearer token
Required prefilled data (the Engine SDK does not ask for these 3 fields):
First name
Last name
Email address
Beyond those, you can pass any other information you have already collected, so the user isn’t asked for it again. Instructions here:
The Engine SDK includes a set of Event Handlers that give you greater visibility into SDK activity and can be used to support your internal reporting and application logic. Instructions here:
The Debt Relief Engine SDK is designed to match your consumer with the most suitable product. If the consumer does not appear to be a good fit for Debt Relief products, the SDK will automatically attempt to qualify them for a Personal Loan instead.
When a consumer meets both of the conditions below, the SDK will request additional Personal Loan fields to complete qualification:
EngineSdk
bearerToken={// API token obtained in Step 1}
prefilledData={{
firstName: “John”,
lastName: “Doe”,
email:
johndoe@gmail.com
// more data that you don’t want to ask user again
}}
primaryColor=”#11AA34”
secondaryColor=”#444444”
clientTags={ ...optional Client Tags, please see following Client Tag section }
{ ...optional event handlers, please see Event Handler section below }