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

@getyetty-sdk/rubypayeur

v2026.8.7-4

Published

TypeScript client for the RubyPayeur scoring and debt recovery APIs

Readme

@getyetty-sdk/rubypayeur

TypeScript client for the RubyPayeur scoring and debt recovery APIs.

Install

npm install @getyetty-sdk/rubypayeur

Usage

Scoring

import { RubyPayeurScoringClient } from '@getyetty-sdk/rubypayeur';

const scoring = new RubyPayeurScoringClient({
  apiToken: process.env.RUBYPAYEUR_SCORING_TOKEN,
});

const result = await scoring.getCompanyScoring('123456789');
// { score: 75, letter: 'A', color: 'dark_green', risk: 'Very low - excellent credit rating' }

Debt recovery (Recouvrement)

import { RubyPayeurRecouvrementClient } from '@getyetty-sdk/rubypayeur';

const client = new RubyPayeurRecouvrementClient({
  apiToken: process.env.RUBYPAYEUR_RECOUVREMENT_TOKEN,
  isProduction: true,
});

// Validate credentials
const valid = await client.validateCredentials();

// Create a debt recovery case
const debt = await client.createDebt({
  debtor: {
    name: 'Acme Corp',
    registrationNumber: '123456789',
    gender: 'male',
    firstName: 'Jean',
    lastName: 'Dupont',
    email: '[email protected]',
  },
  invoices: [
    {
      reference: 'FA-2024-001',
      amountDueCents: 150000,
      issuedOn: '2024-01-15',
      dueOn: '2024-02-15',
    },
  ],
  lateFee: true,
});

// Fetch a single debt by reference
const single = await client.getDebt('ABC123');

// Fetch all debts (paginated automatically)
const all = await client.getDebts([]);

// Fetch specific debts by reference
const filtered = await client.getDebts(['REF-1', 'REF-2']);

// Iterate page by page (memory-efficient for large datasets)
for await (const page of client.iterateDebts()) {
  console.log(`Got ${page.length} debts`);
  // break early if needed — remaining pages won't be fetched
}

Custom logger

All clients accept an optional logger for structured logging:

const client = new RubyPayeurRecouvrementClient({
  apiToken: '...',
  isProduction: true,
  logger: {
    log: (msg) => console.log(msg),
    warn: (msg) => console.warn(msg),
    error: (msg) => console.error(msg),
  },
});

Error handling

The SDK throws typed errors you can catch individually:

| Error | When | | --------------------- | ----------------------------------------------------- | | AuthenticationError | Invalid or expired API token | | NotFoundError | Resource not found (404 or empty result) | | ValidationError | Validation failed (422), .fieldErrors has details | | RateLimitedError | Rate limited (429), .retryAfterSeconds if available | | ServerError | 5xx after exhausting retries, .statusCode available | | ResponseShapeError | API response didn't match expected Zod schema |

All errors extend RubyPayeurError.

Features

  • Automatic authentication with token caching and transparent re-auth on 401
  • Retry with exponential backoff on 5xx and network errors (3 retries)
  • Zod runtime validation at API response boundaries with .passthrough() for forward compatibility
  • Test mode: set isProduction: false to use a sandbox SIREN

License

MIT