node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »


Webmention Client

Travis CI Test Status

A simple client to ping a WebMention service.


var webmention = require('webmention-client');
var source = '';
var target = '';

function webmentionComplete(err, response) {
  if (err) {
    // Handle error
    console.log(err, response);
  else {
    // woot

webmention(source, target, webmentionComplete);


webmention(sourceUrl, targetUrl, callback);

The sourceUrl is your URL, a blog post or article, that contains a link to the targetUrl at another location. The callback parameter is a callback function that is called:

callback(err, result);

The err parameter is any potential error encountered during the HTTP request.

The result parameter is an object containing a success boolean and a response object. If the response is JSON, this will be available as the response object; if the response is blank or non-JSON, it will be available as response.raw instead. For further information, see the WebMention specification.