{"_id":"@banklyze/sdk","_rev":"2-828c79423af7207b02862ca7525cd8b9","name":"@banklyze/sdk","dist-tags":{"latest":"1.3.1"},"versions":{"1.3.0":{"name":"@banklyze/sdk","version":"1.3.0","keywords":["banklyze","mca","underwriting","bank-statement","fintech","api","sdk"],"license":"MIT","_id":"@banklyze/sdk@1.3.0","maintainers":[{"name":"thornebridge","email":"jaice@thornebridge.tech"}],"homepage":"https://docs.banklyze.com/sdk/typescript","bugs":{"url":"https://github.com/thornebridge/banklyze-node/issues"},"dist":{"shasum":"5b2bcdf3cf814b4ff0ad893655ac6dfb3b8d1e9e","tarball":"https://registry.npmjs.org/@banklyze/sdk/-/sdk-1.3.0.tgz","fileCount":16,"integrity":"sha512-xM4vNOBhXnPnuNVT8i4+vgFJDjvT/q7UuOa0sW5VcT6fSR9AhDGUQYPENnMrscl+lLP7qsOS/SmBQRi+7w/rDQ==","signatures":[{"sig":"MEUCIQCag9oc28CXlLDyHnzPLriHt5cue4ocnH8+4cBkunDjgQIgAIh3jrRDckT+1428VCIXudhEr+AZEl0cNqKMVNP44J4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":593154},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./webhooks":{"import":{"types":"./dist/webhooks.d.ts","default":"./dist/webhooks.js"},"require":{"types":"./dist/webhooks.d.cts","default":"./dist/webhooks.cjs"}}},"gitHead":"be1f1991b7983e83424aaf7d6d21390137a87799","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","clean":"rm -rf dist","test:ci":"vitest run","type-check":"tsc --noEmit"},"_npmUser":{"name":"thornebridge","email":"jaice@thornebridge.tech"},"repository":{"url":"git+https://github.com/thornebridge/banklyze-node.git","type":"git"},"_npmVersion":"11.6.0","description":"Official TypeScript SDK for the Banklyze API — AI-powered MCA underwriting platform","directories":{},"_nodeVersion":"24.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^2.0.0","typescript":"^5.5.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.3.0_1774538936815_0.35794656837081806","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"name":"@banklyze/sdk","version":"1.3.1","description":"Official TypeScript SDK for the Banklyze API — AI-powered MCA underwriting platform","license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./webhooks":{"import":{"types":"./dist/webhooks.d.ts","default":"./dist/webhooks.js"},"require":{"types":"./dist/webhooks.d.cts","default":"./dist/webhooks.cjs"}}},"homepage":"https://docs.banklyze.com/sdk/typescript","repository":{"type":"git","url":"git+https://github.com/thornebridge/banklyze-node.git"},"bugs":{"url":"https://github.com/thornebridge/banklyze-node/issues"},"keywords":["banklyze","mca","underwriting","bank-statement","fintech","api","sdk"],"engines":{"node":">=20"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest","test:ci":"vitest run","type-check":"tsc --noEmit","clean":"rm -rf dist"},"devDependencies":{"@types/node":"^20.0.0","tsup":"^8.0.0","typescript":"^5.5.0","vitest":"^2.0.0"},"_id":"@banklyze/sdk@1.3.1","gitHead":"be1f1991b7983e83424aaf7d6d21390137a87799","_nodeVersion":"24.9.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-3qAXxTPxnYkAjXmgTXa4vJwRjMMteWFsILe7R9Eo8K/zwyjYkVbL/jaOaY19r13xH3AlQBHJBrJL8h5RVjRJBw==","shasum":"26b8f0f2065f3f810d07633a2dad9546962ab2bd","tarball":"https://registry.npmjs.org/@banklyze/sdk/-/sdk-1.3.1.tgz","fileCount":12,"unpackedSize":246766,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDClRxNQsopt7ZYMI+VQ6NMkHifuvi3MAbM+12m7aulNAIhAMC/FPfhAJqyopjBtrM8atuHfAZ5rZ4W3MNlSbDRIqYA"}]},"_npmUser":{"name":"thornebridge","email":"jaice@thornebridge.tech"},"directories":{},"maintainers":[{"name":"thornebridge","email":"jaice@thornebridge.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.3.1_1774539194588_0.5320144139860477"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-26T15:28:56.703Z","modified":"2026-03-26T15:33:14.864Z","1.3.0":"2026-03-26T15:28:56.972Z","1.3.1":"2026-03-26T15:33:14.729Z"},"bugs":{"url":"https://github.com/thornebridge/banklyze-node/issues"},"license":"MIT","homepage":"https://docs.banklyze.com/sdk/typescript","keywords":["banklyze","mca","underwriting","bank-statement","fintech","api","sdk"],"repository":{"type":"git","url":"git+https://github.com/thornebridge/banklyze-node.git"},"description":"Official TypeScript SDK for the Banklyze API — AI-powered MCA underwriting platform","maintainers":[{"name":"thornebridge","email":"jaice@thornebridge.tech"}],"readme":"<div align=\"center\">\n<br />\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://banklyze.com/icons/banklyze-mark-white.svg\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://banklyze.com/icons/Banklyze-Logo.svg\">\n  <img alt=\"Banklyze\" src=\"https://banklyze.com/icons/Banklyze-Logo.svg\" width=\"48\">\n</picture>\n<br />\n<samp><b>B A N K L Y Z E</b></samp>\n\n<br />\n<br />\n\n### Upload a bank statement. Get an underwriting decision.\n\nThe official TypeScript SDK for the Banklyze API.<br />\nTurn months of manual underwriting into a single API call.\n\n<br />\n\n[![npm](https://img.shields.io/npm/v/@banklyze/sdk?style=flat-square&color=0a0a0a&labelColor=0a0a0a)](https://www.npmjs.com/package/@banklyze/sdk)\n&nbsp;\n[![MIT](https://img.shields.io/badge/license-MIT-0a0a0a?style=flat-square&labelColor=0a0a0a)](LICENSE)\n&nbsp;\n[![Node 20+](https://img.shields.io/badge/node-20+-0a0a0a?style=flat-square&labelColor=0a0a0a)](https://nodejs.org)\n&nbsp;\n[![TypeScript](https://img.shields.io/badge/types-strict-0a0a0a?style=flat-square&labelColor=0a0a0a)](https://www.typescriptlang.org)\n&nbsp;\n[![Zero deps](https://img.shields.io/badge/dependencies-0-0a0a0a?style=flat-square&labelColor=0a0a0a)](package.json)\n\n<br />\n\n[Get API Key](https://banklyze.com) &nbsp;&middot;&nbsp; [Documentation](https://docs.banklyze.com) &nbsp;&middot;&nbsp; [API Reference](https://docs.banklyze.com/api)\n\n<br />\n</div>\n\n---\n\n<br />\n\n## 7 lines. That's it.\n\n```typescript\nimport { Banklyze } from \"@banklyze/sdk\";\n\nconst client = new Banklyze({ apiKey: \"bk_live_...\" });\n\nconst deal = await client.deals.create({ business_name: \"Acme Trucking LLC\" });\nawait client.documents.upload(deal.id, \"./statements/chase_jan.pdf\");\n\nconst result = await client.deals.get(deal.id);\nconsole.log(result.recommendation.decision); // \"approved\"\n```\n\nThat PDF just went through OCR extraction, LLM parsing, transaction screening, tamper detection, 12-factor health scoring, and a full underwriting recommendation. Your team didn't write a single rule.\n\n<br />\n\n## Why teams switch to Banklyze\n\n<table>\n<tr>\n<td width=\"50%\">\n\n### Before Banklyze\n- Manual PDF review (20-40 min per deal)\n- Spreadsheet-based scoring\n- Inconsistent underwriting criteria\n- No tamper detection\n- Weeks to onboard new data sources\n\n</td>\n<td width=\"50%\">\n\n### After Banklyze\n- Automated analysis (seconds per deal)\n- 12-factor composite health scoring\n- Configurable rulesets with version history\n- PDF integrity + tampering detection\n- One API call to process any bank statement\n\n</td>\n</tr>\n</table>\n\n<br />\n\n## Banklyze vs. the alternatives\n\n| | **Banklyze** | Ocrolus | LendAPI | Plaid (Asset Reports) | DIY (in-house) |\n|---|:---:|:---:|:---:|:---:|:---:|\n| Upload PDF &rarr; full underwriting decision | **Yes** | No | Partial | No | Build it yourself |\n| Bank statement + tax return + P&L support | **All three** | Statements only | Statements only | No PDFs | Depends on scope |\n| LLM-powered extraction | **Yes** | Template OCR | Template OCR | N/A | Build it yourself |\n| Tamper / fraud detection | **Built in** | Add-on | No | No | Build it yourself |\n| Health scoring (12 sub-factors) | **Built in** | No | Basic | No | Build it yourself |\n| Underwriting recommendation engine | **Built in** | No | Basic | No | Build it yourself |\n| Custom rulesets with version history | **Yes** | No | No | No | Build it yourself |\n| MCA position detection | **Yes** | No | No | No | Build it yourself |\n| Real-time SSE streaming | **Yes** | Polling | Polling | Polling | Build it yourself |\n| Typed SDKs (Python + TypeScript) | **Both** | Python only | None | Multiple | N/A |\n| Pricing | **Per document** | Per document | Per document | Per connection | Engineering time |\n\nWe don't just extract data from bank statements. We **understand** them — and give you a decision you can act on.\n\n<br />\n\n## Install\n\n```bash\nnpm install @banklyze/sdk\n```\n\n> Requires Node.js 20+. Zero runtime dependencies — uses native `fetch`, `crypto`, and `fs`.\n\n<br />\n\n## Everything is typed\n\nEvery method returns a fully typed interface. Not `any`. Not `unknown`. Real types with real autocompletion.\n\n```typescript\nconst detail = await client.deals.get(dealId);\n\n// IDE knows every field, every nested object, every type\ndetail.health.health_score;                    // number\ndetail.health.health_grade;                    // string\ndetail.recommendation.decision;                // \"approved\" | \"conditional\" | \"declined\"\ndetail.recommendation.risk_factors;            // string[]\ndetail.recommendation.strengths;               // string[]\ndetail.financials.avg_monthly_deposits;        // number\ndetail.mca?.mca_credit_score;                  // number | undefined\n\n// 12 health sub-factors, individually scored and weighted\nfor (const [name, factor] of Object.entries(detail.health.factors)) {\n  console.log(`${name}: ${factor.score}/${factor.max} (weight: ${factor.weight})`);\n}\n```\n\nAll response types are forward-compatible. New API fields are accepted automatically — your code never breaks on deploy.\n\n<br />\n\n## Document intelligence, built in\n\nUpload a PDF and get back structured intelligence — no OCR pipeline to build, no LLM prompts to tune.\n\n```typescript\nconst doc = await client.documents.get(docId);\n\n// Pre-screen (regex-based, instant, no LLM cost)\ndoc.prescreen.bank_name;          // \"Chase\"\ndoc.prescreen.opening_balance;    // 15420.00\ndoc.prescreen.viable;             // true\ndoc.prescreen.confidence;         // 0.95\n\n// Tamper detection\ndoc.integrity.tampering_risk_level;  // \"clean\" | \"low\" | \"medium\" | \"high\"\ndoc.integrity.tampering_flags;       // string[]\n\n// Extraction confidence scoring\ndoc.extraction_confidence_detail.overall_confidence;  // 0.94\ndoc.extraction_confidence_detail.overall_tier;        // \"HIGH\"\n\n// Cross-document validation\ndoc.analysis.validation_is_reliable;       // true\ndoc.analysis.validation_discrepancies;     // ValidationDiscrepancy[]\n```\n\n<br />\n\n## Instant analysis — no account required\n\nLet prospects try Banklyze before they sign up. The instant endpoint processes a PDF in under 2 seconds with no data persistence.\n\n```typescript\nconst result = await client.instant.analyze(\"./statement.pdf\");\n\nconsole.log(result.summary.total_deposits);         // 284500.00\nconsole.log(result.summary.total_mca_positions);    // 3\nconsole.log(result.summary.avg_revenue_quality);    // 0.82\n\n// Per-file breakdown\nfor (const file of result.results) {\n  console.log(file.bank_name, file.nsf_count, file.mca_daily_obligation);\n}\n```\n\n<br />\n\n## Real-time pipeline streaming\n\nWatch documents process in real time. No polling.\n\n```typescript\nfor await (const event of client.events.stream(dealId)) {\n  switch (event.event) {\n    case \"stage\":\n      console.log(`Stage: ${event.data}`);  // \"extracting_text\" → \"parsing\" → \"screening\" → \"scoring\"\n      break;\n    case \"complete\":\n      console.log(\"Analysis complete\");\n      break;\n  }\n}\n```\n\n<br />\n\n## Auto-pagination\n\nForget page math. Iterate over thousands of records with a single loop.\n\n```typescript\nfor await (const deal of client.deals.listAll({ status: \"ready\" })) {\n  console.log(deal.business_name, deal.health_grade);\n  // Typed as DealSummary — full autocompletion\n}\n```\n\n<br />\n\n## Error handling that doesn't suck\n\nEvery error is a typed class with the context you need to debug. No parsing strings.\n\n```typescript\nimport { NotFoundError, RateLimitError, ValidationError } from \"@banklyze/sdk\";\n\ntry {\n  await client.deals.get(dealId);\n} catch (err) {\n  if (err instanceof NotFoundError) {\n    // err.statusCode === 404\n  } else if (err instanceof RateLimitError) {\n    // err.retryAfter — seconds until you can retry\n  } else if (err instanceof ValidationError) {\n    // err.body — full validation error details\n  }\n  // Every error has err.requestId for instant support correlation\n}\n```\n\n<br />\n\n## Webhook verification in one line\n\n```typescript\nimport { verifySignature } from \"@banklyze/sdk/webhooks\";\n\n// HMAC-SHA256 with constant-time comparison. Timing attacks don't apply.\nverifySignature(requestBody, headers[\"x-webhook-signature\"], \"whsec_...\");\n```\n\n<br />\n\n## Built for production\n\n<table>\n<tr><td><strong>Automatic retries</strong></td><td>Exponential backoff with jitter. Honors <code>Retry-After</code>. Safe for mutations — POST/PUT/PATCH only retry on connection errors, never on HTTP status codes.</td></tr>\n<tr><td><strong>Idempotency</strong></td><td>Pass an idempotency key on any write. Retry all you want.</td></tr>\n<tr><td><strong>Request tracking</strong></td><td>Every request gets a UUID. Every error includes it. <code>client.lastRequestId</code> is always available.</td></tr>\n<tr><td><strong>Timeouts</strong></td><td>Sensible defaults per operation type. <code>TIMEOUT_READ</code> (10s), <code>TIMEOUT_WRITE</code> (30s), <code>TIMEOUT_UPLOAD</code> (120s), <code>TIMEOUT_REPORT</code> (300s).</td></tr>\n<tr><td><strong>Forward compatible</strong></td><td>All types accept unknown fields. API updates never break your build.</td></tr>\n<tr><td><strong>Dual CJS + ESM</strong></td><td>Works with <code>import</code> and <code>require</code>. Ship anywhere.</td></tr>\n</table>\n\n<br />\n\n## Configuration\n\n```typescript\nconst client = new Banklyze({\n  apiKey: \"bk_live_...\",          // required\n  baseUrl: \"https://api.banklyze.com\",  // default\n  timeout: 30_000,                // default (ms)\n  maxRetries: 2,                  // default\n  logger: console,                // optional debug logging\n});\n```\n\n<br />\n\n## 25 resources. Full API coverage.\n\nEvery endpoint in the Banklyze API has a typed method in this SDK.\n\n| | Resource | What it does |\n|-|----------|-------------|\n| **Core** | `client.deals` | CRUD, decision, evaluate, notes, stats, analytics, batch |\n| | `client.documents` | Upload, bulk upload, status, reprocess, triage, classify |\n| | `client.transactions` | List, correct, corrections history |\n| | `client.exports` | Deal and document CSV/PDF exports |\n| | `client.rulesets` | Underwriting criteria CRUD, versioned, set default |\n| **Intelligence** | `client.instant` | Free-tier instant PDF analysis (sub-2s, no persistence) |\n| | `client.bvl` | Business validation runs, call queue, SAM entities |\n| | `client.samProfiles` | SAM.gov search profiles, watchers, automated triggers |\n| | `client.reviews` | Document review queue, approve/correct workflow |\n| **Real-time** | `client.events` | SSE streams for deals, org events, batch progress |\n| | `client.webhooks` | Webhook config, test, delivery logs, retry |\n| | `client.notifications` | In-app notifications and preferences |\n| | `client.push` | Web push subscriptions |\n| **Platform** | `client.team` | Invite, update, deactivate members |\n| | `client.keys` | API key management |\n| | `client.shares` | Public deal share links |\n| | `client.ingest` | Bulk CRM ingest with batch tracking |\n| | `client.crm` | Provider config, field mapping, bidirectional sync |\n| | `client.integrations` | Slack, Teams, SMTP notification channels |\n| | `client.admin` | Health, usage, error logs, DLQ, pipeline settings |\n| | `client.usage` | Metering and processing time analytics |\n| | `client.oauth` | Client credentials token exchange |\n\n**Plus 5 sub-resources on every deal:**\n\n```typescript\nclient.deals.comments.list(dealId);       // threaded discussion\nclient.deals.assignments.create(dealId);  // assign reviewers\nclient.deals.docRequests.create(dealId);  // request missing docs\nclient.deals.timeline.list(dealId);       // full activity history\nclient.deals.users.search({ q: \"jane\" }); // find team members\n```\n\n<br />\n\n## Retry behavior\n\n| Method | Rate limit (429) | Server error (5xx) | Connection error |\n|--------|:---:|:---:|:---:|\n| GET / DELETE | Retry | Retry | Retry |\n| POST / PUT / PATCH | &mdash; | &mdash; | Retry |\n\nExponential backoff with jitter. 500 ms base, 30 s cap. Honors `Retry-After`.\n\n<br />\n\n## We ship fast\n\nThis SDK is actively maintained by the Banklyze engineering team. We release weekly, respond to issues within 24 hours, and treat SDK quality with the same rigor as our core platform.\n\nIf something isn't right, [open an issue](https://github.com/thornebridge/banklyze-node/issues). We'll fix it.\n\n<br />\n\n## License\n\nMIT &mdash; use it however you want.\n\n<br />\n\n<div align=\"center\">\n\n**[Get your API key](https://banklyze.com)** and start analyzing statements in minutes.\n\n<br />\n\nBuilt with care by the [Banklyze](https://banklyze.com) team.\n\n</div>\n","readmeFilename":"README.md"}