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 🙏

© 2025 – Pkg Stats / Ryan Hefner

the-passkey-toolkit

v1.0.0

Published

Framework agnostic passkey client helpers made with @simplewebauthn/browser.

Readme

The Passkey Toolkit

A small framework-agnostic package for WebAuthn passkeys.

  • BYOB (Bring Your Own Backend) — available import { … } from "the-passkey-toolkit/byob"
  • Cloud (Managed backend) — coming soon import { … } from "the-passkey-toolkit/cloud"

Installation

npm i the-passkey-toolkit @simplewebauthn/browser

BYOB (Bring Your Own Backend)

https://github.com/user-attachments/assets/58eec93e-2b55-4274-9750-2e2f1d815932

Import from the /byob. Works with your API routes that create options and verify credentials (a handled service coming soon).

import {
    setBaseUrl, // optional: set if your API is on a different origin
    setAPIKey, // optional: adds API header to every request (extra added security)
    registerPasskey, // create new passkey
    authorizePasskey, // sign in with existing passkey
} from "the-passkey-toolkit/byob";

Quick start

Same origin (default):

setBaseUrl("https://api.myapp.com"); // if your have a different origin

const ok = await registerPasskey("[email protected]", "Alice");
if (!ok) {
    // registration failed for whatever reason
}

With cancel/timeout (AbortController):

const ac = new AbortController();
setTimeout(() => ac.abort(), 15000);
await registerPasskey("[email protected]", "Bob", ac.signal); // <-- add ac.signal as an arg

Optional: API key

You can add a header to every request for rate limiting etc.

// default header is "x-api-key"
setApiKey(import.meta.env.VITE_TPK_API_KEY);

// or use custom header name
setApiKey(import.meta.env.VITE_TPK_API_KEY, "x-whatever-key");

please kep in mind that api keys set in frontend are not secure and should not be used for authentication!

API

setBaseUrl(url: string): void
setApiKey(key: string, headerName?: string): void // default header: "x-api-key" (this is optional)
registerPasskey(email: string, displayName?: string, abortSignal?: AbortSignal): Promise<boolean>
authorizePasskey(email?: string, abortSignal?: AbortSignal): Promise<boolean>

A true is returned from registerPasskey, and authorizePasskey when your server responds { verified: true } on the verify step.

Required backend routes!

Implement these JSON endpoints:

  • POST /api/passkey/registration/optionsPublicKeyCredentialCreationOptionsJSON
  • POST /api/passkey/registration/verify{ "verified": boolean }
  • POST /api/passkey/authentication/optionsPublicKeyCredentialRequestOptionsJSON
  • POST /api/passkey/authentication/verify{ "verified": boolean }

The client sends credentials: "include". Configure cookies & CORS accordingly please.


☁️ Cloud (Managed) — Coming Soon

Zero backend work. Our hosted API.


License

MIT © Milan White