Debt Relief SDK

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

Yarn

yarn add @moneylion/react-native-debt-relief-sdk @react-native-async-storage/async-storage

pnpm

pnpm add @moneylion/react-native-debt-relief-sdk @react-native-async-storage/async-storage

Step 4: Initialize the SDK

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:

You can also pass any unique identifiers (userid, campaign, etc) you want for attribution/tracking as Client Tags. 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:

Connecting with Personal Loans

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:

  • Requested amount is less than $5,000, and

  • Self-assessed credit score is above 660

The additional Personal Loan fields are:

  • Home-Owner vs Renter

  • Education Level

  • Employment Status

  • Annual Income

  • Social Security Number

EngineSDK Props

Name

Type

Default

Description

endpoint

string

Optional custom API endpoint. If not provided, the SDK will use https://api.engine.tech by default

bearerToken

string

Required

The API token obtained from Partner Manager. Used to authenticate requests to the Engine API.

prefilledData

Required: firstName, lastName, email

User information to prepopulate the Debt Relief flow. See the Prefilled Data section for details.

primaryColor

string (RGBA hex)

-

Primary theme color for the SDK UI (e.g., #FF0000FF).

secondaryColor

string (RGBA hex)

-

Secondary theme color for the SDK UI.

clientTags

-

Optional tags used for tracking performance of specific campaigns or users. See the ClientTags section for details.

onInitialize

(props) => void

-

Triggered when the SDK initializes. See the Events page.

onCreate

(props) => void

-

Called after a lead is created. See the Events page.

onUpdate

(props) => void

-

Called when a lead is updated. See the Events page.

onNavigate

(props) => void

-

Fired when the user navigates between SDK screens. See the Events page.

onSubmit

(props) => void

-

Fired when the user submits their information. See the Events page.

onRateTableRender

(props) => void

-

Called when the user submits their information to the Engine service and receives offers. See the Events Page

onOfferClick

(props) => void

-

Fired when a user clicks an offer. See the Events page.

onErrorPageView

(props) => void

-

Triggered when the user is driven to the Error page. See the Events page.

onErrorPageRetry

(props) => void

-

Trigger when the user taps “Retry” on the error page. See the Events page.

onError

(props) => void

-

Fired when an error occurs during SDK operations. See the Events page.

onExit

(props) => void

-

Fired when the user attempts to exit the SDK flow. See the Events page.

User Flow

Last updated

Was this helpful?