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 🙏

© 2025 – Pkg Stats / Ryan Hefner

webmention-receiver

v0.6.0

Published

webmention receiver with webmention-handler

Downloads

21

Readme

Webmention Receiver

Store Webmentions in Netlify using Functions and Blobs.

A full working example can be found at the serverless-webmentions repository.

Installation

npm install webmention-receiver --save

Usage

import WebmentionReceiver from 'webmention-receiver'
export const wm = new WebmentionReceiver({
	urls: ['example.com', 'www.example.com', 'example.net'],
	token: 'random-long-string',                                        // optional
	webhook: 'URL to send POST request to after webmention received'    // optional
})

By default, this project uses webmention-handler-netlify-blobs to store webmentions in Netlify Blobs.

You can then set up your Netlify Functions to call specific handlers. For example:

// /functions/webmention.js
import WebmentionReceiver from 'webmention-receiver'
const wm = new WebmentionReceiver({
	urls: ['example.com', 'www.example.com', 'example.net'],
	webhook: process.env.WEBHOOK
})
export const handler = wm.webmentionHandler

The above would call webmentionHandler when you call your function located at /.netlify/functions/webmention.

Configuration

  • urls (required): The only required parameter is a list of valid URLs that you accept webmentions to (without https?://).
  • token (optional): There are some parts of the WebmentionReceiver that require a token and they will not work unless it is set and the value passed matches. You can generate a token or use any long random string for the token.
  • webhook (optional): This should be a URL which will receive a POST request after the webmention is received. It has specifically been tested with ntfy.sh but could also be any other endpoint that will accept a simple POST request.

Handlers

webmentionHandler

This is the main handler that will accept a webmention given a source and valid target. If valid, it will be added to a queue to be processed at a later time.

  • You can also call this handler with DELETE and token to force remove a specific webmention.

processHandler

This will process the queue of pending webmentions and process them and, if valid, will show up as part of your webmentions for the given target.

webmentionsHandler

Returns a list of webmentions for a given target url, optionally filtered by type. You can also return a list of all webmentions received grouped by target by ommitting the url parameter. Getting the list of all webmentions requires passing the token parameter.

importHandler

You can import all webmentions from webmention.io by using this handler. Requires token and webmentionio token as parameters.

cleanupHandler

For testing and local use only. Accepts GET requests and requires token.

This handler will go through all the blobs for your site and delete them. This is mostly useful while testing this setup out and should not be exposed when you deploy this publicly.