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

web-bot-auth

v0.2.0

Published

Web Bot Authentication using HTTP Message Signatures

Readme

web-bot-auth

License crates.io

TypeScript helpers for Web Bot Auth, as described in draft-meunier-webbotauth-httpsig-protocol-00.

Table of Contents

Features

  • Web Bot Auth request signing and verification policy
  • Ed25519 and RSA-PSS/SHA-512 JWK signers and verifiers
  • Signature-Agent, registry, and Signature Agent Card parsers
  • TypeScript types

Usage

This section shows basic signing and verification. More concrete examples are provided on cloudflareresearch/web-bot-auth/examples.

Research server for debug purposes

To help debug web-both-auth HTTPS requests, Cloudflare Research provides a test endpoint on https://http-message-signatures-example.research.cloudflare.com/debug. You may also run this research server's code on GitHub on a local endpoint.

Signing

import { generateNonce, sign } from "web-bot-auth";
import { signerFromJWK } from "web-bot-auth/crypto";

const signatureAgent = 'sig1="https://signature-agent.test";type=directory';
const request = new Request("https://example.com", {
  headers: { "Signature-Agent": signatureAgent },
});

// This is a testing-only private key/public key pair described in RFC 9421 Appendix B.1.4
// Also available at https://github.com/cloudflareresearch/web-bot-auth/blob/main/examples/rfc9421-keys/ed25519.json
const RFC_9421_ED25519_TEST_KEY = {
  kty: "OKP",
  crv: "Ed25519",
  alg: "EdDSA",
  kid: "test-key-ed25519",
  d: "n4Ni-HpISpVObnQMW0wOhCKROaIKqKtW_2ZYb2p9KcU",
  x: "JrQLj5P_89iXES9-vFgrIy29clF9CC_oPPsw3c5D0bs",
};

const now = new Date();
const fields = await sign(request, {
  signer: await signerFromJWK(RFC_9421_ED25519_TEST_KEY),
  created: now,
  expires: new Date(now.getTime() + 300_000),
  nonce: generateNonce(),
});

// Et voila! Here is our signed request.
const signedRequest = new Request("https://example.com", {
  headers: {
    Signature: fields.signature,
    "Signature-Agent": signatureAgent,
    "Signature-Input": fields.signatureInput,
  },
});

Verifying

import { verify } from "web-bot-auth";
import { verifierFromJWK } from "web-bot-auth/crypto";

// available at https://github.com/cloudflareresearch/web-bot-auth/blob/main/examples/rfc9421-keys/ed25519.json
const RFC_9421_ED25519_TEST_KEY = {
  kty: "OKP",
  crv: "Ed25519",
  alg: "EdDSA",
  kid: "test-key-ed25519",
  x: "JrQLj5P_89iXES9-vFgrIy29clF9CC_oPPsw3c5D0bs",
};

// Reusing the incoming request signed in the above section
const signedRequest = new Request("https://example.com", {
  headers: {
    Signature: fields.signature,
    "Signature-Agent": signatureAgent,
    "Signature-Input": fields.signatureInput,
  },
});

const verifier = await verifierFromJWK(RFC_9421_ED25519_TEST_KEY);
const authenticated = await verify(signedRequest, {
  // Resolve only from trusted local configuration. The candidate is untrusted.
  resolver: (candidate) => {
    if (candidate.keyid !== verifier.keyid) throw new Error("unknown key");
    return verifier;
  },
  validate: ({ nonce }) => {
    // Atomically reject a nonce already present in your replay cache.
  },
});

Security Considerations

This software has not been audited. Please use at your sole discretion.

License

This project is under the Apache-2.0 license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be Apache-2.0 licensed as above, without any additional terms or conditions.