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

@puzzle-ui/auth

v0.12.0

Published

Framework-independent authentication for accounts, MFA, passkeys, and lifecycle workflows.

Readme

@puzzle-ui/auth

Framework-independent authentication primitives for Puzzle applications. Use this package when you need server-side registration and password sign-in, session validation, email and password lifecycle flows, MFA, passkeys, recovery codes, or step-up authentication without tying your auth core to a framework.

Documentation: puzzle-ui.com/docs/auth

Install

npm install @puzzle-ui/auth

The package uses @puzzle-ui/storage and @puzzle-ui/session adapters, and includes a SimpleWebAuthn server adapter. You provide a storage adapter, a session manager, a secure Argon2id PasswordHasher (or the included Pbkdf2PasswordHasher with a secret pepper on runtimes such as Cloudflare Workers), a shared RateLimitProvider, and an email provider for lifecycle workflows.

Minimal usage

import { StorageAuthManager } from "@puzzle-ui/auth";

const auth = new StorageAuthManager(
  { storage, passwordHasher, rateLimitProvider, sessions },
  { rateLimitKeySecret },
);

await auth.initialize();

const result = await auth.register({
  email: "[email protected]",
  password: "a-long-unique-password",
  ipAddress: trustedClientIp,
});

if (!("status" in result)) {
  // Store result.token in a secure, HttpOnly cookie on the server.
}

Keep session and challenge tokens server-side. The token must not be sent in browser JSON or stored in local or session storage. Add the MFA manager to the dependencies and configure mfaPolicy when MFA is needed.

Features and entry point

The package exports all APIs from the single root entry point, @puzzle-ui/auth:

  • StorageAuthManager for registration, password sign-in, auth state and session revocation.
  • StorageAuthLifecycleManager for email verification/change, password reset/change, profile updates, account deactivation and deletion.
  • StorageAuthMfaManager for TOTP, WebAuthn passkeys, recovery codes and factor management.
  • StorageAuthStepUpManager for session-bound additional MFA verification and session rotation.
  • StorageRateLimitProvider, WebCryptoAuthSecretProtector, and SimpleWebAuthnProvider as built-in infrastructure adapters.
  • Typed provider contracts, storage records and collection setup, auth errors, and crypto/TOTP utilities.

For storage adapter capabilities and initialization, see @puzzle-ui/storage. For browser clients, secure cookie handlers, and framework adapters, see @puzzle-ui/fullstack. The Authentication Setup guide describes application integration.

Security notes

Auth requires durable storage with the capabilities used by the configured managers. Production deployments should use HTTPS, secure HttpOnly cookies, shared persistent rate limiting, a maintained Argon2id password hasher (or a peppered Pbkdf2PasswordHasher), encrypted TOTP secrets, hashed recovery codes, and exact WebAuthn origin/RP ID configuration. The package does not provide OAuth, application authorization, or ready-made auth pages.