npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

altfiscore

v0.1.0

Published

Official Node.js SDK for the AltFiScore alternative credit scoring and decisioning API

Readme

AltFiScore Node.js SDK

Official Node.js / TypeScript client for the AltFiScore alternative credit scoring and loan decisioning API.

Alternative credit scoring and decisioning infrastructure for banks, credit unions, fintechs, BNPL providers, and embedded lenders.

Installation

npm install altfiscore

Requires Node.js 18+ (uses the built-in fetch). Ships with TypeScript types.

Quickstart

import { AltFiScore } from "altfiscore";

const client = new AltFiScore("altfi_test_...");

const decision = await client.decisions.bnpl({
  consumer: {
    first_name: "Ada",
    last_name: "Okoro",
    email: "[email protected]",
    dob: "1990-01-15",
    ssn_last4: "1234",
  },
  order: {
    amount: "450.00",
    currency: "USD",
    installment_count: 4,
  },
});

if (decision.isApproved) {
  console.log(`Approved ${decision.approvedAmount} at ${decision.apr}% APR`);
  for (const installment of decision.paymentSchedule) {
    console.log(installment.due_date, installment.amount);
  }
} else if (decision.isReferred) {
  console.log("Counter-offer:", decision.counterOffer);
} else if (decision.isDeclined) {
  for (const reason of decision.declineReasons) {
    console.log(reason.code, reason.reason);
  }
}

Products

Every product is a method on client.decisions:

await client.decisions.bnpl({ consumer, order });
await client.decisions.autoLoan({ consumer, loan, vehicle, dealer });
await client.decisions.mortgage({ consumer, loan, property });
await client.decisions.personalLoan({ consumer, loan });
await client.decisions.creditCard({ consumer, product });

Returning consumers

Pass a consumer_id instead of full PII to score a consumer you have already onboarded:

const decision = await client.decisions.personalLoan({
  consumer: { consumer_id: "b0c9ed84-f66c-4598-b50a-a0d8b2ddcd04" },
  loan: { amount: "12000.00", currency: "USD", term_months: 36 },
});

Pending decisions (consumer verification)

Larger amounts trigger enhanced or hard KYC. When that happens the decision is returned in a pending state:

const decision = await client.decisions.mortgage({ consumer, loan, property });

if (decision.isPending) {
  // Redirect the consumer to complete verification
  console.log(decision.consumerCompleteUrl);

  // Then poll until the decision is final
  const final = await client.decisions.poll("mortgage", decision.decisionId!, {
    timeoutMs: 180000,
  });
  console.log(final.outcome);
}

Idempotency

Pass an idempotencyKey to make create calls safe to retry. Reusing a key returns the original decision instead of creating a new one:

const decision = await client.decisions.bnpl({
  consumer,
  order,
  idempotencyKey: "order-98a7f3",
});

Error handling

import {
  AuthenticationError,
  InvalidRequestError,
  RateLimitError,
  APIError,
} from "altfiscore";

try {
  const decision = await client.decisions.bnpl({ consumer, order });
} catch (err) {
  if (err instanceof AuthenticationError) {
    // bad or revoked API key
  } else if (err instanceof InvalidRequestError) {
    // 400/422 - inspect err.body for details
  } else if (err instanceof RateLimitError) {
    // 429 - back off and retry
  } else if (err instanceof APIError) {
    // 5xx or unexpected - err.statusCode available
  }
}

A declined applicant is not an error - it is a successful decision with decision.isDeclined === true. Exceptions are only thrown for transport and API-level failures.

Configuration

const client = new AltFiScore("altfi_live_...", {
  baseUrl: "https://api.altfiscore.com", // override for sandbox/self-host
  timeout: 30000,                         // per-request milliseconds
  maxRetries: 2,                          // idempotent requests only
});

Documentation

Full API reference: https://altfiscore.com/developers

License

MIT