Get started with Pre-Approvals with our step-by-step guide.
states
is an array of all the states that are defined in the SDK’s exported interface PreApproval
. You will need to either create this array or cast the value of state
from string
to as PreApproval['state']
to ensure that value is valid for the SDK.DRIVLY_API_KEY
and will start in sandbox
.
react-hook-form
to handle the form state and @hookform/resolvers
to use the Zod schema to validate the form data.
We will use Server Actions for this example.Let’s create a server action that uses the SDK to create Danny’s pre-approval.
updatePreApproval
action.
preApprovalId
to access his pre-approval. This will allow you to show him cars that he can afford and give him an idea of what his interest rate will be.