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

@blumbo/auth

v0.1.1

Published

Blumbo platform: prove a request came through the edge, and read the identity it asserted.

Readme

@blumbo/auth

Two halves of "who is the caller", for an app running behind the Blumbo edge.

An app behind the gate never authenticates anyone. It does not verify a token, hold a Clerk secret key, or decide who anyone is. Identity arrives in X-Blumbo-* headers that the edge strips from the incoming request and rewrites from the gate's answer, and this package is the one place that is read, so every app reads it the same way.

Install

npm install @blumbo/auth

Two entrypoints and no root export — import '@blumbo/auth' resolves to nothing.

Server

import {
  ANONYMOUS,
  devIdentity,
  GATEWAY_HEADER,
  gatewaySecret,
  IDENTITY_HEADERS,
  identityFrom,
  isFromGateway,
} from '@blumbo/auth/server'

// Once, at startup — not per request. A missing secret in production is then
// a failed deploy rather than a wall of 500s.
const GATEWAY_SECRET = gatewaySecret()
const DEV_IDENTITY = devIdentity()

app.use('*', (c, next) => {
  if (!isFromGateway(c.req.header(GATEWAY_HEADER), GATEWAY_SECRET)) {
    return c.text('Direct access is not permitted.', 403)
  }
  return next()
})

// Note the shape: `identityFrom` wants an object keyed `user` / `name` /
// `orgs`, not a bag of raw HTTP headers. Passing `c.req.header()` straight in
// typechecks and silently returns null forever. Take the names from
// `IDENTITY_HEADERS` so they cannot drift from what the gate sends.
const who = identityFrom({
  user: c.req.header(IDENTITY_HEADERS.user),
  name: c.req.header(IDENTITY_HEADERS.name),
  orgs: c.req.header(IDENTITY_HEADERS.orgs),
}) ?? DEV_IDENTITY ?? ANONYMOUS

Three things worth knowing:

  • Call gatewaySecret() from a module your server loads before it serves. Under a lazily-loaded route the throw happens on the first request instead of at boot, which gives you a deploy that passes its health check and then answers everything with a 500.
  • Exempt your health-check path from the gateway check. The platform probes it directly, so it cannot carry the header.
  • devIdentity() reads BLUMBO_DEV_USER / _NAME / _ORGS for local work and throws if it is ever set in production, where a stand-in identity would be a complete authentication bypass.

Client

Session tokens live sixty seconds, and a background fetch cannot renew one: the handshake that would is only issued for navigations. A page open longer than a minute therefore loses its writes unless something in the page keeps a live session. That is what this half is for.

import { authFetch, startAuth } from '@blumbo/auth/client'

// The publishable key is served by your own server at runtime, never bundled:
// a bundler inlines it, which makes the image specific to one Clerk instance.
const { publishableKey } = await (await fetch('/api/config')).json()
const fetcher = authFetch(await startAuth({ publishableKey }))

await fetcher('/api/save', { method: 'POST', body })

startAuth returns null when no key is configured, and authFetch(null) is plain fetch — so local development works with no Clerk instance at all.

authFetch retries once on a 401 with a force-minted token. That closes the common case and not every case: a refresh timer is throttled in a background tab and stops entirely while a device sleeps. Anything a user earned should survive independently — hold it locally and flush it on next load rather than reporting a failure.