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

@signalbox/webhook

v0.4.1

Published

signalbox plugin: receive inbound HTTP webhooks and emit them as events

Downloads

197

Readme

@signalbox/webhook

signalbox plugin for HTTP webhooks in both directions: receive inbound requests as events (mounted on the shared @signalbox/http server), and fire requests at outbound targets from your workflows.

Part of signalbox — see the full documentation.

Install

npm install @signalbox/webhook @signalbox/http

http is only needed for inbound routes; outbound targets work on their own.

Receiving (inbound)

import { httpPlugin } from "@signalbox/http"
import { webhookPlugin } from "@signalbox/webhook"

const http = httpPlugin({ port: 8080 })
const plugins = {
    http,
    webhook: webhookPlugin({
        http,
        routes: {
            "gh-push": { path: "/hooks/github" },
        },
    }),
}

// in a workflow — subscribe by route name:
ctx.plugins.webhook.events.flow("gh-push").effect(request => {
    ctx.log(`hook: ${JSON.stringify(request.body)}`)
})

Each configured route becomes an event stream you subscribe to with events.flow("<route>"). The plugin doesn't open its own port — it mounts routes on the shared HTTP server, so one server serves your API and your hooks together.

Sending (outbound)

Declare named targets and fire requests at them with send:

import { webhookPlugin, z } from "@signalbox/webhook"

const plugins = {
    webhook: webhookPlugin({
        targets: {
            deploy: {
                url: "https://ci.example.com/hooks/deploy",
                request: z.object({ ref: z.string() }), // typed + validated body
                headers: { authorization: "Bearer …" },
                secret: "shared-secret", // sent as x-webhook-secret
            },
        },
    }),
}

// in a workflow — send() is typed to the target's schema:
const res = await ctx.plugins.webhook.send("deploy", { ref: "main" })
if (!res.ok) ctx.log(`deploy hook failed: ${res.status}`, "warn")

send(target, body, options?) resolves with { status, ok, headers, body } (the response body is JSON-parsed when possible). If the target declares a request schema, body is typed as its inferred type and validated before sending — an invalid body throws, and schema defaults/transforms are applied to the payload; otherwise body is unknown. An object body is JSON-encoded, a string is sent as-is. A non-2xx status does not throw — inspect res.ok — but a network failure does. Per-call options can override the method or add headers.

z is re-exported for convenience (so you don't add a zod dependency yourself).

You can configure routes and targets together, or use either on its own.

License

MIT