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

@reality-cap/client

v1.0.1

Published

Frontend SDK for Reality Cap — hardware-backed WebAuthn verification for any form

Readme

@reality-cap/client

Frontend SDK for Reality Cap. Uses the WebAuthn API (Face ID, Touch ID, Windows Hello) to cryptographically sign form payloads before they are transmitted to your server.

npm License: MIT

What it does

This package handles the browser-side of the Reality Cap flow:

  1. Takes your form data and hashes it (SHA-256) together with a unique nonce.
  2. Uses the browser's WebAuthn API to force the user's device (Face ID, Touch ID, or Windows Hello) to sign that hash with its hardware private key.
  3. Returns a signed rcBundle that you attach to your API request.

The server can then verify that the bundle was signed by a real device and that the data was not altered in transit.

Installation

npm install @reality-cap/client

Usage

React Hook

import { useRealityCap } from "@reality-cap/client/react";

function CheckoutForm() {
  const { authenticate, status, error } = useRealityCap({ rpName: "My Store" });

  const handleSubmit = async (e) => {
    e.preventDefault();
    const formData = { item: "Laptop", address: "123 Main St" };

    const result = await authenticate(formData);
    if (result.success) {
      await fetch("/api/checkout", {
        method: "POST",
        body: JSON.stringify({ ...formData, rcBundle: result.bundle }),
      });
    }
  };

  return (
    <form onSubmit={handleSubmit}>
      {/* your form fields */}
      <button disabled={status === "prompting"}>
        {status === "prompting" ? "Scanning..." : "Checkout"}
      </button>
      {error && <p style={{ color: "red" }}>{error.message}</p>}
    </form>
  );
}

Vanilla JavaScript

import { authenticate } from "@reality-cap/client";

const result = await authenticate({ item: "Laptop", address: "123 Main St" });
if (result.success) {
  console.log("Bundle ready to send:", result.bundle);
}

API

useRealityCap(options?)

React hook. Returns { authenticate, status, error, hasCredential }.

| Option | Type | Default | Description | | :--- | :--- | :--- | :--- | | rpName | string | "Reality Cap" | The display name shown in the biometric prompt. | | rpId | string | window.location.hostname | The domain the passkey is locked to. |

authenticate(data, options?)

Core function. Takes any JSON-serializable object and returns { success: boolean, bundle?: RcBundle }.

Requirements

  • Browser: WebAuthn support required (Chrome 67+, Safari 14+, Firefox 60+, Edge 18+).
  • Device: Must have biometric hardware (Face ID, Touch ID, Android Biometrics, or Windows Hello). Users on legacy hardware without biometrics cannot complete the flow. Build a fallback.