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

@portola/passage

v1.4.0

Published

Official TypeScript SDK for the Passage API

Downloads

40

Readme

@portola/passage

Official TypeScript SDK for the Passage API - the loan distribution platform by Portola.

Installation

npm install @portola/passage

Requirements: Node.js 18+

Which SDK Should I Use?

| SDK | Use Case | |-----|----------| | @portola/passage-neobank | Recommended for neobanks. High-level SDK with encryption helpers, webhook handling, and a streamlined API. | | @portola/passage | Low-level API client for advanced use cases or when building custom integrations. | | @portola/passage-lender | For lender integrations (coming soon). |

This package provides auto-generated TypeScript clients with direct access to the underlying API. Most integrations should use the higher-level SDKs above.

Quick Start

import { Configuration, ApplicationsApi } from '@portola/passage';

const config = new Configuration({
  apiKey: process.env.PASSAGE_API_KEY,
  basePath: 'https://api.tryportola.com/api/v1',
});

const applications = new ApplicationsApi(config);

// List applications
const response = await applications.listApplications();
console.log(`Found ${response.data.data?.applications?.length} applications`);

Available API Clients

Core APIs

| Client | Description | |--------|-------------| | ApplicationsApi | Create and manage loan applications | | OffersApi | View and accept loan offers (prequal and final) | | LoansApi | Manage funded loans and payment schedules | | SigningApi | Document signing sessions via HelloSign | | FundingApi | Loan funding operations and consent |

Discovery & Configuration APIs

| Client | Description | |--------|-------------| | EntityDiscoveryApi | Discover lenders, neobanks, and their capabilities | | NeobankSelfServiceApi | Neobank account settings, webhooks, and API keys | | KeyManagementApi | Encryption key rotation and revocation | | AttestationApi | KYC attestations and trust evaluation |

Infrastructure APIs

| Client | Description | |--------|-------------| | SDXApi | Secure Document Exchange token generation | | PlatformApi | Platform-level operations | | QueueApi | Lender queue management | | TransfersApi | Money movement and transfers | | TreasuryApi | Treasury and wallet management |

SDX Service (Document Storage)

| Client | Description | |--------|-------------| | BlobsApi | Upload and download encrypted documents | | HealthApi | SDX service health checks |

Configuration

import { Configuration, ApplicationsApi } from '@portola/passage';

const config = new Configuration({
  // Required
  apiKey: process.env.PASSAGE_API_KEY,
  basePath: 'https://api.tryportola.com/api/v1',

  // Optional: Custom axios options
  baseOptions: {
    timeout: 30000,
    headers: {
      'User-Agent': 'my-app/1.0.0',
    },
  },
});

const applicationsApi = new ApplicationsApi(config);
const offersApi = new OffersApi(config);
// ... create other API clients as needed

Environments

The Passage API uses a single endpoint. Your environment (sandbox vs production) is determined by your API key prefix:

| API Key Prefix | Environment | Blockchain | |----------------|-------------|------------| | nb_test_* | Sandbox | Base Sepolia (testnet) | | nb_live_* | Production | Base Mainnet | | lender_test_* | Sandbox (lenders) | Base Sepolia (testnet) | | lender_live_* | Production (lenders) | Base Mainnet |

// Same code works for both environments - just swap the API key
const config = new Configuration({
  apiKey: process.env.PASSAGE_API_KEY, // nb_test_* or nb_live_*
  basePath: 'https://api.tryportola.com/api/v1',
});

Error Handling

The SDK throws Axios errors. Handle them appropriately:

import { Configuration, ApplicationsApi } from '@portola/passage';
import { AxiosError } from 'axios';

const config = new Configuration({
  apiKey: process.env.PASSAGE_API_KEY,
  basePath: 'https://api.tryportola.com/api/v1',
});

const applications = new ApplicationsApi(config);

try {
  const response = await applications.getApplication('invalid-id');
} catch (error) {
  if (error instanceof AxiosError) {
    const status = error.response?.status;
    const data = error.response?.data;

    switch (status) {
      case 400:
        console.error('Validation error:', data);
        break;
      case 401:
        console.error('Invalid API key');
        break;
      case 403:
        console.error('Not authorized to access this resource');
        break;
      case 404:
        console.error('Resource not found');
        break;
      case 429:
        const retryAfter = error.response?.headers['retry-after'];
        console.error(`Rate limited. Retry after ${retryAfter}s`);
        break;
      default:
        console.error('API error:', status, data);
    }
  } else {
    throw error;
  }
}

Tip: The higher-level @portola/passage-neobank SDK provides typed error classes (ValidationError, NotFoundError, etc.) for easier error handling.

Namespace Imports

To avoid naming conflicts, you can import API clients under namespaces:

import { PassageAPI, PassageSDX } from '@portola/passage';

// Use namespaced access
const config = new PassageAPI.Configuration({
  apiKey: process.env.PASSAGE_API_KEY,
  basePath: 'https://api.tryportola.com/api/v1',
});

const applications = new PassageAPI.ApplicationsApi(config);
const blobs = new PassageSDX.BlobsApi(sdxConfig);

TypeScript Support

This package includes full TypeScript definitions. All request and response types are exported:

import type {
  // Application types
  ApplicationRequest,
  ApplicationResponse,
  ApplicationStatus,

  // Offer types
  EncryptedOffer,
  OfferAcceptanceRequest,
  OfferAcceptanceResponse,

  // Loan types
  Loan,
  LoanStatus,
  PaymentScheduleResponse,

  // Signing types
  CreateSigningSessionRequest,
  SigningSessionCreateResponse,

  // And many more...
} from '@portola/passage';

Full Documentation

For complete documentation, guides, and examples:

Related Packages

License

MIT