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

cognito-express-middleware

v2.0.0

Published

Frozen re-export of cognito-toolkit/express — this middleware moved into cognito-toolkit v3.

Readme

cognito-express-middleware NPM version

This package moved into cognito-toolkit v3 as the subpath export cognito-toolkit/express. Version 2.0.0 of this package is a frozen re-export thunk — it forwards everything from cognito-toolkit/express and will receive no further development. Depend on cognito-toolkit directly:

import {CognitoJwtVerifier} from 'cognito-toolkit';
import {makeAuth} from 'cognito-toolkit/express';

const verifier = CognitoJwtVerifier.create({userPoolId: 'us-east-1_MY_POOL', clientId: 'my-app-client', tokenUse: 'access'});
const auth = makeAuth({verifier});

app.use(auth.getUser); // req.user = decoded payload or null
app.get('/protected', auth.isAuthenticated, handler);

What changed in 2.0.0

  • The implementation is now cognito-toolkit/express, built on AWS's official aws-jwt-verify — the 1.x homegrown verification stack is gone.
  • getUser({region, userPoolId}) became makeAuth({verifier}) — you create the verifier via CognitoJwtVerifier.create(...) (note: clientId and tokenUse are now first-class checks).
  • The former module statics (getUser.isAuthenticated, getUser.hasGroup, getUser.hasScope, getUser.isAllowed, getUser.stateUserProperty) are now members of the per-instance bundle returned by makeAuth — same names, same semantics.
  • The auth-cookie features are preserved (authCookie, setAuthCookieOptions, user.setAuthCookie); the cookie domain now defaults to the request hostname (the 1.x req.host default breaks on Express 5, which keeps the port there).
  • ESM-only (CommonJS consumers use require(esm) with named exports); Node 20+.

See the full migration guide and the cognito-toolkit documentation.

The last standalone release of this package is 1.4.9 (its documentation lives in this repo's git history and wiki).

License

The 3-Clause BSD License