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

@7h3/protocol-browser

v0.6.1

Published

7h3 Protocol - Browser/Edge SDK. Pure Web Crypto API. Zero dependencies.

Readme

@7h3/protocol-browser

7h3 Protocol — Browser/Edge SDK. Pure Web Crypto, zero dependencies, sideEffects: false.

npm install @7h3/protocol-browser

A self-contained implementation of the 7h3/0.1 wire format for environments where you want the smallest possible surface: sign, verify, validate, and attach an envelope to a fetch. If you need gateways, capability tokens, replay stores or encryption, use @7h3/protocol — it is also pure Web Crypto and runs in the browser unchanged.

Use

import {
  generateKeypair,
  createEnvelope,
  signEnvelope,
  verifyEnvelope,
  validateEnvelope,
} from '@7h3/protocol-browser'

const { publicKey, privateKey } = await generateKeypair()

const envelope = createEnvelope({
  sender: '[email protected]',
  body: { intent: 'TASK', content: 'hello' },
  ttlMs: 60_000,
})

const signed = await signEnvelope(envelope, privateKey, 'k1')
await verifyEnvelope(signed, publicKey)   // → true

createEnvelope takes a nested body here, unlike the core's flattened { intent, content }. The wire format is identical either way.

Validation

validateEnvelope(signed)
// → [] when valid, otherwise [{ level: 'error', message: '…' }]

Enforces the same rules as the TypeScript, Python, Rust and Go SDKs: the wire version, presence of messageId / sender / nonce, finite timestampMs and ttlMs, the 24h MAX_TTL_MS ceiling, the 30s MAX_CLOCK_SKEW_MS future-timestamp ceiling, and expiry.

isEnvelopeExpired fails closed: a non-finite timestamp or TTL counts as expired, because NaN + NaN < now is false and naive arithmetic would wave such an envelope through.

Signing a request

import { signRequest, ENVELOPE_HEADER } from '@7h3/protocol-browser'

const request = await signRequest(new Request(url, { method: 'POST' }), {
  sender: '[email protected]',
  privateKey,
  keyId: 'k1',
})

Cross-SDK guarantee

An envelope signed here verifies under every other 7h3 SDK and vice versa. That is not an aspiration — src/browserParity.test.ts compares canonical bytes, round-trips signatures in both directions, and asserts that both SDKs emit identical validation diagnostics for every malformed envelope.

Requirements

A secure contextcrypto.subtle is unavailable over plain HTTP (localhost counts). Ed25519 in Web Crypto needs a current browser.

Do not ship a private key to the browser. A page-generated key is fine for signing that visitor's own session artifacts; anything representing your origin's identity must be signed server-side.

Building agent tools?

Use @7h3/protocol-webmcp — capability scoping, replay protection and signed receipts for WebMCP tools.

License

Apache-2.0