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

@faable/auth-helpers-fastify

v1.0.16

Published

<p align="center"> <a href="https://faable.com"> <h1 align="center">Faable Auth Fastify Plugin</h1> </a> <p align="center">Faable Auth JWT verification plugin for Fastify.</p> </p>

Readme

This plugin verifies Faable Auth JWTs on incoming Fastify requests. It fetches the appropriate JWKS for your tenant, validates the token's iss, signature and expiration, and exposes the decoded user via request.user.

Install

npm install @faable/auth-helpers-fastify fastify fastify-plugin

Peer dependencies: fastify ^5.0.0, fastify-plugin ^5.0.1.

Usage

Register the plugin once on your Fastify instance, then guard individual routes with the faableAuth() prehandler.

import Fastify from "fastify";
import faableAuthPlugin from "@faable/auth-helpers-fastify";

const app = Fastify();

await app.register(faableAuthPlugin, {
  domain: "https://<team>.auth.faable.com",
});

app.post("/private", { preHandler: app.faableAuth() }, (req, res) => {
  // req.user        → decoded JWT payload ({ sub, scopes? })
  // req.user_id     → req.user.sub
  // req.faableAuthClientType → "user" | "client"
  return res.send({ message: "Access granted", user_id: req.user_id });
});

// Optional auth — populates req.user when present, never rejects
app.get("/public", { preHandler: app.faableAuth({ required: false }) }, (req) => ({
  authenticated: Boolean(req.user_id),
}));

await app.listen({ port: 3000 });

Configuration

Plugin options

| Option | Type | Default | Description | | -------- | -------- | ---------------------- | --------------------------------------------------------------------------- | | domain | string | FAABLEAUTH_DOMAIN env | Faable Auth tenant URL used as the allowed JWT issuer (iss). Required. |

Prehandler options (faableAuth(options))

| Option | Type | Default | Description | | ---------- | ---------- | ------- | --------------------------------------------------------------------------- | | required | boolean | true | When true, missing/invalid tokens reject with 401 Unauthorized. When false, the request continues with req.user undefined. | | scopes | string[] | [] | Reserved for scope-based access control (currently not enforced). |

Environment variables

| Variable | Description | | -------------------------- | ---------------------------------------------------------- | | FAABLEAUTH_DOMAIN | Tenant URL — fallback when domain is not passed in code. | | FAABLEAUTH_CLIENT_ID | App Client ID (used by other helpers, e.g. axios). | | FAABLEAUTH_CLIENT_SECRET | App Client Secret (used by other helpers, e.g. axios). |

What gets attached to the request

| Property | Type | Description | | -------------------------- | --------------------- | ---------------------------------------------------------------------------------------- | | request.user | { sub, scopes? } | Decoded JWT payload. | | request.user_id | string | Shortcut to request.user.sub. | | request.faableAuthClientType | "user" \| "client" | "user" when sub starts with user_, otherwise "client" (machine-to-machine token). |

License

MIT