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

@twire/relay

v0.1.0

Published

Prescreened webhook and secure tunnel runtime client for Bot Relay.

Readme

@twire/relay

Prescreened webhook utilities and a secure bot-runtime tunnel client for Bot Relay.

Features

  • HTTP long-poll runtime client (createRelayRuntime)
  • Canonical HMAC verification (verifyRelaySignature)
  • Nonce replay and idempotency stores (in-memory adapters included)
  • Webhook prescreening (prescreenWebhookRequest)
  • Next.js route adapter (createNextWebhookHandler)

Install

npm i @twire/relay

Runtime quick start

import { createRelayRuntime } from "@twire/relay";

const runtime = createRelayRuntime({
  relayUrl: process.env.TWIRE_RELAY_URL!,
  botId: process.env.TWIRE_BOT_ID!,
  sharedSecret: process.env.TWIRE_RELAY_SECRET!
});

runtime.onDelivery(async (delivery) => {
  await delivery.verify();
  await handleEvent(delivery.event, delivery.payload, delivery.meta);
  await delivery.ack({ detail: "processed" });
});

await runtime.connect();

Default runtime endpoints:

  • /api/relay/runtime/pull
  • /api/relay/runtime/ack
  • /api/relay/runtime/nack

Prescreen quick start

import { prescreenWebhookRequest } from "@twire/relay";

const result = await prescreenWebhookRequest({
  method: "POST",
  botId: "wallet_0xabc123",
  rawBody: JSON.stringify({ event: "wallet.transfer", payload: { tx: "0x..." } }),
  contentType: "application/json",
  clientIp: "203.0.113.10"
});

Security defaults

  • Timestamp skew tolerance: 300s
  • Nonce TTL: 10m
  • Idempotency retention: 24h

Canonical signature base string:

METHOD + "\n" + PATH + "\n" + TIMESTAMP + "\n" + NONCE + "\n" + SHA256(BODY)

Smoke suites

  • npm run smoke:contract (mock relay server, deterministic)
  • npm run smoke:live (SMOKE_MODE=local or SMOKE_MODE=hosted-public)

Supported smoke env vars:

  • SMOKE_BASE_URL (default http://localhost:3000, hosted default https://bot-relay.com)
  • SMOKE_MODE (contract | local | hosted-public)
  • SMOKE_TIMEOUT_MS (default 15000)
  • SMOKE_SHARED_SECRET (required for signed tunnel checks)
  • SMOKE_BOT_ID_PREFIX (default smoke-relay)
  • SMOKE_REQUIRE_TUNNEL (default true in local mode, false in hosted-public mode)