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

@heyhef/api-client

v0.0.1

Published

Generated TypeScript API client for the CRO platform

Readme

@heyhef/api-client

Generated TypeScript API client for the CRO platform (from api/openapi.yaml).

Quick start

  1. Install dependencies (from package root):
cd packages/api-client
npm install
  1. Build the client (produces dist/ with JS + type declarations):
npm run build
  1. Use in your app:
import { OpenAPI, ExperimentsService } from '@heyhef/api-client';

OpenAPI.BASE = process.env.API_BASE || 'http://localhost:3000';
OpenAPI.TOKEN = async () => localStorage.getItem('token') || undefined;

const cfg = await ExperimentsService.fetchExperimentConfig('exp-id', 'visitor-123');

Notes

  • The client expects fetch to be available. In Node, we recommend installing cross-fetch.
  • The package includes a minimal TypeScript config for building and producing declaration files.

Publishing & CI

This package can be published to npm as a private (restricted) scoped package and automated via GitHub Actions.

  1. Confirm package scope
  • The package name in package.json is scoped (e.g. @heyhef/api-client). Make sure the scope (@heyhef) matches your npm organization or change it to your intended scope.
  1. Create an npm automation token
  • Go to https://www.npmjs.com/ (log in), then Account Settings -> Access Tokens -> Create New Token -> choose "Automation" (read & publish) and create the token. Copy it somewhere safe.
  1. Add the token to GitHub Secrets
  • In the GitHub repo: Settings -> Secrets -> Actions -> New repository secret
  • Name: NPM_TOKEN
  • Value: the token you created on npm
  1. Verify CI workflow
  • A workflow was added at .github/workflows/publish-api-client.yml which runs on push to main and will:
    • Build packages/api-client
    • Run npm publish --access restricted using NODE_AUTH_TOKEN from ${{ secrets.NPM_TOKEN }}
  1. Dry-run locally (optional)

You can run a dry-run to see what would be published:

cd packages/api-client
npm pack --dry-run
# or
npm publish --access restricted --dry-run
  1. Publish manually (optional)

If you prefer to publish manually (instead of via CI), run:

cd packages/api-client
npm ci
npm run build
npm publish --access restricted
  1. Local development alternatives
  • To test the package locally without publishing, you can create a tarball and install it in the consumer project:
cd packages/api-client
npm pack
# in consumer
npm install ../api-client/api-client-0.1.0.tgz
  • Or use npm link for local linking. If global npm link fails due to permissions, you can use a user prefix and run:
mkdir -p ~/.npm-global
npm_config_prefix=~/.npm-global npm link
# Then in consumer project:
npm_config_prefix=~/.npm-global npm link @heyhef/api-client
# ensure ~/.npm-global/bin is in your PATH:
export PATH="$HOME/.npm-global/bin:$PATH"
  1. Token security
  • Use an automation token scoped to publishing and rotate it periodically. Revoke tokens from npm account settings if compromised.

If you'd like, I can run a local npm publish --access restricted --dry-run for you to preview the publish contents, or prepare a PR that updates the package scope to your real npm org before you publish.