SDK (@ippopone/loanpilot)
The official TypeScript / JavaScript SDK.
SDK
npm install @ippopone/loanpilotimport { LoanPilot } from '@ippopone/loanpilot'
import fs from 'node:fs'
const lp = new LoanPilot({ apiKey: process.env.LOANPILOT_API_KEY! })
const created = await lp.analyses.create({
file: fs.readFileSync('statement.pdf'),
fileName: 'statement.pdf',
productId: 'optional-product-id',
inputs: { requested_amount: 500000, collateral_value: 700000 },
})
const analysis = await lp.analyses.waitFor(created.id) // polls until completed
console.log(analysis.decision, analysis.score)
console.log(analysis.result) // full reportMethods
await lp.me()
await lp.analyses.list({ limit, offset, status, decision })
await lp.analyses.create({ file, fileName, password?, productId?, applicant?, inputs? })
await lp.analyses.get(id, { includeResult: true })
await lp.analyses.waitFor(id, { pollMs, timeoutMs, onPoll })
await lp.products.list()
// credit bureau (billable; needs entitlement + consent)
await lp.creditChecks.create({ name, mobile, consent: true })
await lp.creditChecks.list({ limit, offset })
await lp.creditChecks.get(id)Mobile / per-user sign-in
For apps, sign the user in instead of shipping a key (see Authentication):
const { token, client } = await LoanPilot.login({ email, password })
// store `token` in secure storage; next launch:
const lp = new LoanPilot({ apiKey: savedToken })
await lp.logout() // revoke on sign-outOptions
new LoanPilot({
apiKey,
baseUrl: 'https://api.ippo.one/v1', // default
timeoutMs: 60000,
maxRetries: 2, // retries 429/5xx with backoff
fetch: customFetch, // optional
headers: { 'X-Trace': '...' },
})Errors throw LoanPilotError with status, code and detail. Works in Node 18+ and modern browsers
(global fetch/FormData/Blob).