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

fiftyyears-auth

v0.1.0

Published

Drop-in Google login gate for fiftyyears apps. One shared OAuth client, minimal per-app setup.

Readme

fiftyyears-auth

Drop-in Google login gate for fiftyyears apps. One shared Google OAuth client across every app — minimal per-app setup, no new OAuth client per app.

One-time (once, ever)

Google Cloud Console → create one OAuth 2.0 Client (Web application):

  • Consent screen: External, scopes openid email profile.
  • You'll add each app's callback URL to this one client's Authorized redirect URIs (Google has no API for this — Console only).

Keep the Client ID + Secret; every app reuses them.

Per app

  1. Add env vars in Vercel:
    GOOGLE_CLIENT_ID=<shared>
    GOOGLE_CLIENT_SECRET=<shared>
    AUTH_SESSION_SECRET=<32+ random chars, unique per app>
    AUTH_BASE_URL=https://<this-app>.vercel.app
    [email protected]   # optional; empty = any Google account
  2. Add this app's callback to the shared OAuth client's redirect URIs: https://<this-app>.vercel.app/api/auth/callback
  3. npm install fiftyyears-auth
  4. Four API routes (one line each):
    // api/auth/login.ts
    export { loginHandler as default } from "fiftyyears-auth/server"
    // api/auth/callback.ts
    export { callbackHandler as default } from "fiftyyears-auth/server"
    // api/auth/logout.ts
    export { logoutHandler as default } from "fiftyyears-auth/server"
    // api/auth/me.ts
    export { meHandler as default } from "fiftyyears-auth/server"
  5. Wrap the app:
    import { AuthGate } from "fiftyyears-auth"
    <AuthGate appName="My App"><App /></AuthGate>
  6. Gate any API route:
    import { requireAuth } from "fiftyyears-auth/server"
    export default requireAuth(async (req, res, user) => { /* user is signed in */ })

Notes

  • Session is a signed httpOnly cookie (7-day), HS256 over AUTH_SESSION_SECRET.
  • Google's ID token is verified against Google's JWKS (issuer + audience checked).
  • useAuth() gives { user, loading, logout } inside the gate.
  • The only recurring manual step per app is #2 (add one redirect URI) — Google exposes no API for it.