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

iracing-data-client

v0.4.0

Published

Fully-typed HTTP Client for the iRacing Data API with automatic code generation, opt-in caching, smart authentication, and comprehensive error handling.

Readme

iRacing Data Client

A TypeScript client for the iRacing Data API with full type safety and automatic OAuth2 authentication.

ℹ️ Authentication has been migrated to the new iRacing OAuth2 system. The legacy email/password authentication has been replaced with OAuth2 client credentials. See the Authentication guide for details.

  • 🏎️ Complete coverage of the iRacing Data API (72+ endpoints)
  • 🔒 OAuth2 authentication with automatic token refresh
  • 📝 Full TypeScript support with generated types
  • 🔄 Automatic camelCase conversion for JavaScript conventions
  • 🎯 Runtime parameter validation using Zod schemas
  • ⚡ Opt-in response caching, request deduplication, and rate limiting via pluggable stores
  • 🔁 Opt-in retry preset with exponential backoff for transient failures
  • 📊 Structured observability events and pending request counts
  • 🛡️ Maintenance mode and rate limit detection

Documentation

Installation

npm install iracing-data-client
# or
pnpm add iracing-data-client
# or
yarn add iracing-data-client

Quick Start

You'll need OAuth credentials from iRacing — see OAuth Client Credentials to register.

import { IRacingDataClient } from 'iracing-data-client';

const dataClient = new IRacingDataClient({
  auth: {
    type: 'password-limited',
    clientId: process.env.IRACING_CLIENT_ID,
    clientSecret: process.env.IRACING_CLIENT_SECRET,
    username: process.env.IRACING_USERNAME,
    password: process.env.IRACING_PASSWORD,
  },
});

const tracks = await dataClient.track.get();
const member = await dataClient.member.get({ custIds: [123456] });

Services

  • car - Car assets and information
  • carclass - Car class data
  • constants - Categories, divisions, event types
  • driverStatsByCategory - Driver statistics by category
  • hosted - Hosted session data
  • league - League information and standings
  • lookup - Countries, drivers, licenses, etc.
  • member - Member profiles, awards, participation
  • results - Race results and lap data
  • season - Season information and race guides
  • series - Series data and statistics
  • stats - Member statistics and world records
  • team - Team membership data
  • timeAttack - Time attack season results
  • track - Track assets and configuration

See the API reference for full details.

Error Handling

import { IRacingDataClient, IRacingError } from 'iracing-data-client';

try {
  const data = await dataClient.member.get({ custIds: [123] });
} catch (error) {
  if (error instanceof IRacingError) {
    if (error.isMaintenanceMode) {
      console.log('iRacing is in maintenance mode');
      return;
    }

    console.log(`API Error: ${error.message}`);
    console.log(`Status: ${error.status}`);
  }
}

Contributing

See CONTRIBUTING.md for development setup, including how to configure secrets with dotenvx and run integration tests.

License

ISC License - see LICENSE file for details.

Disclaimer

This is an unofficial client for the iRacing Data API. iRacing is a trademark of iRacing.com Motorsport Simulations, LLC.