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

@cyguin/waitlist

v0.1.8

Published

Email waitlist with position tracking for Next.js

Readme

@cyguin/waitlist

Email waitlist with position tracking and an optional referral loop. Drop into any Next.js app.

Install

npm install @cyguin/waitlist

Quick start

1. Configure the adapter

// lib/waitlist.ts
import { createSQLiteAdapter } from '@cyguin/waitlist/adapters/sqlite';

export const waitlistAdapter = createSQLiteAdapter();

2. Add the API route

// app/api/waitlist/[...cyguin]/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { createWaitlistHandler } from '@cyguin/waitlist/next';
import { waitlistAdapter } from '@/lib/waitlist';

const handler = createWaitlistHandler({ adapter: waitlistAdapter });

export async function GET(req: NextRequest) {
  return handler(req);
}

export async function POST(req: NextRequest) {
  return handler(req);
}

3. Drop in the component

// app/page.tsx
import { WaitlistForm } from '@cyguin/waitlist';

export default function Home() {
  return (
    <main>
      <h1>Join the waitlist</h1>
      <WaitlistForm
        placeholder="Enter your email"
        buttonText="Join waitlist"
      />
    </main>
  );
}

API

POST /api/waitlist

Join the waitlist.

Request:

{
  "email": "[email protected]",
  "referred_by": "TOKEN"
}

Response 201:

{
  "id": "abc123",
  "email": "[email protected]",
  "position": 42,
  "referral_token": "abc123"
}

Response 409 — email already registered:

{ "error": "already_registered" }

GET /api/waitlist?email=xxx

Get your position.

Response 200:

{
  "id": "abc123",
  "email": "[email protected]",
  "position": 42,
  "referral_token": "abc123",
  "joined_at": 1712000000000
}

Response 404:

{ "error": "not_found" }

Referral system

When someone joins via ?ref=TOKEN, their entry records the referrer. Position is informational only — referrals don't move anyone up.

  1. POST returns a referral_token (the entry's id).
  2. Share links like https://yoursite.com/?ref=TOKEN.
  3. New joins with ?ref=TOKEN store the referrer's id.

<WaitlistForm /> Props

| Prop | Type | Default | Description | |---|---|---|---| | className | string | '' | CSS class for the form container | | placeholder | string | 'Enter your email' | Input placeholder text | | buttonText | string | 'Join waitlist' | Button label | | redirectTo | string | — | Redirect here after success with ?ref=TOKEN | | theme | 'light' \| 'dark' | 'dark' | Dark by default. Pass 'light' to switch | | onSuccess | (data: JoinResponse) => void | — | Callback on successful join | | onError | (error: string) => void | — | Callback on error |

Theming

Default is dark. Set --cyguin-* variables wherever you need:

--cyguin-bg: #0a0d17
--cyguin-bg-subtle: #101521
--cyguin-border: #252b3a
--cyguin-border-focus: #f5a800
--cyguin-fg: #f1f3f6
--cyguin-fg-muted: #888888
--cyguin-accent: #f5a800
--cyguin-accent-dark: #c47f00
--cyguin-accent-fg: #0a0a0a
--cyguin-radius: 6px
--cyguin-shadow: 0 1px 4px rgba(0,0,0,0.08)

Use theme="light" to flip to light mode:

<WaitlistForm theme="light" />

Exports

| Export | Description | |---|---| | @cyguin/waitlist | Main package entry — types, adapters, handler | | @cyguin/waitlist/next | Next.js route handler | | @cyguin/waitlist/react | WaitlistForm component | | @cyguin/waitlist/adapters/sqlite | SQLite adapter | | @cyguin/waitlist/adapters/postgres | Postgres adapter |