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

@smart-waitlist/client

v1.0.0

Published

Tiny client SDK for Smart-Waitlist templates. Preview-mode (localStorage) and live-mode (REST).

Downloads

124

Readme

@smart-waitlist/client

Tiny, dependency-free client SDK for Smart-Waitlist waitlists.

The defining feature is preview mode: the SDK works before you have an account. With no project key it captures signups to localStorage, so a waitlist you just dropped into a page is functional immediately. Add a key later and the queue you already collected is imported to the server on first mount — nobody who signed up during preview is lost.

  • Zero dependencies, ESM + CJS, full TypeScript types
  • ~3.4 kB minified
  • Works in any browser framework; no React required

Install

npm install @smart-waitlist/client

Using an AI editor (Cursor, Claude Code, Lovable)? You can skip the manual wiring:

add a waitlist with referral mechanics using smart-waitlist

Quick start

import { SmartWaitlistClient } from '@smart-waitlist/client';

// No key → preview mode. Signups go to localStorage.
const client = new SmartWaitlistClient();

const result = await client.signup({ email: '[email protected]' });
result.position; // 1
result.preview;  // true

Add a project key to switch to live capture. Nothing else changes:

const client = new SmartWaitlistClient({
  projectKey: process.env.NEXT_PUBLIC_SMARTWAITLIST_PROJECT_KEY,
});

client.mode; // 'live'

Get a free key at app.matekudasai.com.

Preview → live

Call syncPreviewQueue() once when the app mounts in live mode. It's a no-op in preview mode and when the queue is empty, so it's safe to call unconditionally:

useEffect(() => {
  client.syncPreviewQueue().catch(() => {});
}, [client]);

The local queue is cleared only after the server confirms the import, and the server de-duplicates by email against the existing waitlist — already-present addresses come back in skipped rather than creating a second row, so a double mount can't double-count anyone.

API

new SmartWaitlistClient(options?)

| Option | Type | Default | Notes | | ------------ | --------- | ----------------------------------- | -------------------------------------------------------- | | projectKey | string | — | Absent or empty → preview mode. | | apiUrl | string | https://app.matekudasai.com/api | Trailing slash is trimmed. | | storage | Storage | window.localStorage when present | Inject for tests or non-browser environments. |

client.mode is 'preview' or 'live' and is fixed at construction.

signup(input): Promise<SignupResult>

input is { email, metadata?, referredBy? }. In preview mode this resolves locally and never touches the network; duplicate emails return their existing position rather than a new one.

interface SignupResult {
  id: string;              // 'preview_…' in preview mode
  email: string;
  position: number;        // 1-based
  referralToken: string;
  referralLink: string | null; // null in preview mode
  verified: boolean;
  preview: boolean;
}

syncPreviewQueue(): Promise<{ imported: number; skipped: number }>

Imports the local preview queue. Returns { imported: 0, skipped: 0 } in preview mode.

getAccessStatus({ email }): Promise<AccessSnapshot>

The canonical "are they in?" check. Access is a live-only concept — preview mode always returns WAITING.

interface AccessSnapshot {
  email: string;
  accessStatus: 'WAITING' | 'GRANTED' | 'REVOKED';
  grantedAt: string | null;
}

getMetadata(): Promise<WaitlistMetadata | null>

Public-safe plan info. Returns null in preview mode. Use watermark to decide whether to render the "Powered by Smart-Waitlist" badge.

interface WaitlistMetadata {
  usedSignups: number;
  signupCap: number | null; // null = unlimited
  plan: 'FREE' | 'PAID';
  watermark: boolean;
  milestones: number[];
}

getPreviewSessionId(): string | null · getPreviewCount(): number

The stable preview session id (minted on first preview signup) and the current local queue size. Useful for building a "connect your waitlist" prompt that carries attribution.

Errors

Live-mode methods throw on a non-2xx response with the status included, e.g. Smart-Waitlist signup failed: 429. Preview-mode calls do not throw on the network because they never make one.

License

MIT