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

onparlay-api-client

v1.0.1

Published

Type-safe API client for OnParlay backend

Readme

@onparlay/api-client

Type-safe API client for OnParlay backend, automatically generated from OpenAPI/Swagger specification.

Installation

npm install @onparlay/api-client

No authentication needed - the package is published to npm public registry.

Usage

import { bulkCreateMatchEntries, MatchEntryData } from "@onparlay/api-client";

// Configure base URL (optional, defaults to http://localhost:3333)
process.env.API_BASE_URL = "https://api.onparlay.com";

const matchEntries: MatchEntryData[] = [
  {
    startDate: "2024-12-25T15:00:00Z",
    homeTeam: "Manchester United",
    awayTeam: "Liverpool",
    competition: "Premier League",
    country: "England",
  },
];

const result = await bulkCreateMatchEntries({
  sportName: "Football",
  sportsbookName: "Bwin",
  matchEntries,
});

console.log(`Created ${result.count} match entries`);

Development

Generate API Client

Simple way (copies from backend repo and generates):

npm run generate:from-backend

This will:

  1. Copy openapi.json from ../onparlay-backend/openapi.json
  2. Generate the TypeScript client from it

Manual steps:

  1. First, export the OpenAPI spec from the backend:

    cd ../onparlay-backend
    npm run export:openapi
  2. Copy it to this repo (or use the script):

    npm run copy-openapi
  3. Generate the client:

    npm run generate

From running backend (alternative):

# Make sure backend is running on http://localhost:3333
OPENAPI_SPEC_URL=http://localhost:3333/api-json npm run generate

Watch mode (regenerates on changes):

npm run generate:watch

Build

npm run build

Publish New Version

Patch version (bug fixes):

npm run publish:patch

Minor version (new features):

npm run publish:minor

Major version (breaking changes):

npm run publish:major

Or manually:

npm version patch  # or minor/major
npm publish

Note: You need to be logged in to npm and have 2FA enabled (required for scoped packages):

  1. Enable 2FA on npm:

    • Go to: https://www.npmjs.com/settings/[your-username]/security
    • Enable "Two-factor authentication"
    • Follow the setup instructions
  2. Login to npm:

    npm login
  3. Publish:

    npm publish

Alternative: If you don't want to use 2FA, create a granular access token:

  • Go to: https://www.npmjs.com/settings/[your-username]/tokens
  • Create token with "Automation" type and "Bypass 2FA" enabled
  • Use it with: npm publish --access public

Configuration

The API client uses axios and can be configured via environment variables:

  • API_BASE_URL: Base URL for API requests (default: http://localhost:3333)

Versioning

This package follows Semantic Versioning:

  • Major: Breaking API changes
  • Minor: New features, backward compatible
  • Patch: Bug fixes, documentation

License

UNLICENSED