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

@saltlending/react-sdk

v2.0.0

Published

Salt React components for partners use

Readme

React Salt SDK

The React Salt SDK provides a set of reusable React components for building crypto-backed loan experiences. It covers two main use cases:

  1. Loan Calculator — A configurable loan quote calculator that lets users select location, amount, term, and LTV to get real-time loan quotes
  2. Loan Origination — A multi-step application flow for personal and business loans, including identity verification, document uploads, and payout configuration

It's intended to be used by SALT partners that have access to SALT's partner API.

Prerequisites

Before using the React Salt SDK, ensure you have:

  • React 18+ or React 19+ installed in your project
  • API credentials from SALT including:
    • API Key or JWT token provider
    • Base URL for the SALT partner API
  • TypeScript support (recommended for better development experience)

Installation

  1. Install the SDK package and its peer dependencies:
npm install @saltlending/react-sdk react react-dom
  1. Import the required CSS styles in your main application file:
import "@saltlending/react-sdk/style.css";

Quick Start

1. Configure API Client and Context

Wrap your application with the ReactSdkContext provider:

import { ReactSdkContext } from "@saltlending/react-sdk/context";
import { ApiClient } from "@saltlending/react-sdk/api";
import "@saltlending/react-sdk/style.css";

// API Key authentication
const apiClient = new ApiClient(
  process.env.SALT_API_KEY,
  process.env.SALT_BASE_URL
);

// Or JWT Token authentication (required for origination flow)
const apiClient = new ApiClient(
  "",
  process.env.SALT_BASE_URL,
  "jwt-token",
  async () => {
    const res = await fetch("/auth/token");
    const data = await res.json();
    return { token: data.access_token, expiresAt: data.expires_at };
  }
);

function App() {
  return (
    <ReactSdkContext.Provider value={apiClient}>
      {/* Your components */}
    </ReactSdkContext.Provider>
  );
}

2. Build a Loan Calculator

import { useLoanCalculatorState } from "@saltlending/react-sdk/hooks";
import {
  LocationSelect,
  AmountInput,
  AccountTypeSelect,
  LoanQuotes,
  LoadingIndicator,
  NonLendableArea,
  RetriableError,
  SubmitButton,
} from "@saltlending/react-sdk/components";

function LoanCalculator() {
  const {
    getInputProps,
    stateValues: state,
    isLoading,
    refetchLoanBounds,
    isError,
  } = useLoanCalculatorState({
    defaultState: {
      accountType: "personal",
      amount: 10000,
      location: { countryCode: "US", sub: "CA" },
      repaymentType: "interest_only",
      baseLTV: 0.7,
      term: 12,
    },
  });

  return (
    <div>
      <LocationSelect label="Where do you live?" {...getInputProps("LocationSelect")} />
      <AmountInput label="How much?" placeholder="$ 0.00" {...getInputProps("AmountInput")} />
      <AccountTypeSelect label="Loan type" {...getInputProps("AccountTypeSelect")} />

      {isLoading ? (
        <LoadingIndicator />
      ) : isError ? (
        <RetriableError onClickRetry={refetchLoanBounds} />
      ) : state.isNonLendableArea ? (
        <NonLendableArea />
      ) : state.loanQuotes ? (
        <LoanQuotes {...getInputProps("LoanQuotes")} />
      ) : null}
    </div>
  );
}

3. Add a Loan Origination Flow

import { PersonalLoanFlow } from "@saltlending/react-sdk/components";

function LoanApplication() {
  return <PersonalLoanFlow accountId="account-123" />;
}

Or for business loans:

import { BusinessLoanFlow } from "@saltlending/react-sdk/components";

function BusinessLoanApplication() {
  return <BusinessLoanFlow accountId="account-456" />;
}

Available Components

Core Components (Loan Calculator)

  • LocationSelect - Geographic location picker
  • AmountInput - Loan amount input with validation
  • AccountTypeSelect - Loan type selection (personal or business)
  • LtvInput - Loan-to-Value ratio selector
  • TermInput - Loan term duration selector
  • LoanQuotes - Loan quote results with repayment type selection
  • CountrySelect - Country-only dropdown (ISO 3166-1)
  • SubmitButton - Action button with loading state
  • LoadingIndicator, NonLendableArea, RetriableError, LegalityIssues - State displays

Form Components (Loan Origination)

  • PersonalInformation, FinancialInformation - Personal loan forms
  • BusinessEntityInformation, BusinessEntityQuestions, BusinessBeneficiaries - Business loan forms
  • BusinessVerificationProof, BusinessAddressProof - Business document uploads
  • AccountAddress, LendingQuestions, ResidencyInformation - Shared forms
  • ConnectBankAccount, LoanPayout, DepositCollateral - Payout and collateral
  • BankruptcySpecificationUpload - Conditional document upload

Flow Components

  • PersonalLoanFlow - Complete personal loan application flow
  • BusinessLoanFlow - Complete business loan application flow
  • LoanFlow - Configurable base flow component

Hooks

  • useLoanCalculatorState - Loan calculator state management
  • useForm - Generic form state with declarative validation
  • useOriginationFlow - Multi-step origination flow orchestration
  • useDocuments - Document upload and management
  • useAccountsProfiles - Account and profile CRUD
  • useLoans - Loan operations and quote generation

Environment Variables

  • SALT_API_KEY - Your SALT API key
  • SALT_BASE_URL - The base URL for SALT's partner API

Component Documentation

For detailed component documentation and interactive examples, see the Storybook Documentation.