webfinger

ActivityPub software usually (but not always!) uses a handle format defined by RFC 7033, Webfinger, which looks like username@domain.example. There’s a ActivityPub and Webfinger report from the Social Web Community Group that details how this interaction works.

All parts of this handle format can include non-ASCII Unicode characters, like accented Latin, Chinese, Arabic, or Hindi scripts. But it takes extra work, so users can’t count on non-ASCII characters being supported in their own or others’ software.

This is a problem for the Fediverse. Of the most-spoken human languages, only three primarily use only ASCII characters (English, Malaysian, Indonesian), for a total of about 500 million people. That means about 90% of humans use languages with non-Latin, or accented, character sets. We are missing an opportunity to include more people worldwide with internationalized handles with names, words and domains in their native languages.

Jim DeLaHunt @jdlh has been doggedly pursuing better support for internationalized Webfinger handles in ActivityPub. To this end, the Social Web Community Group started tracking Internationalized Webfinger Handle Adoption. Covering dozens of servers, clients, and libraries that implement ActivityPub, the tracker helps to discovery which software can interoperate with inclusive handles.

If you know of ActivityPub software that isn’t on this list, or that doesn’t have its adoption tracked (question mark in the matrix), please add an issue or open a PR in the ActivityPub Webfinger task force repository.

About 14 years ago, I created a webfinger package for NodeJS. At the time, NodeJS was only a few years old. I had created pump.io as a new social networking engine and the successor to StatusNet. I needed a client for webfinger lookup — the process of converting a user@domain.tld handle to a API endpoint for processing messages — and there wasn’t one for NodeJS, so I made it.

It is kind of an antique — very old callback-style code that has its own HTTP processing system. It supported the older version of Webfinger, RFC 6415, using XML for the data format. It also supported the (at that time) new Webfinger specification, RFC 7033.

Since its last release in 2013, version 0.4.2, I hadn’t touched the project. It’s just been languishing in the npm repository, squatting on the “webfinger” package name, and collecting dust. The Webfinger RFC was published, ActivityPub was standardized, and the Fediverse grew and grew, without a single change to the package.

I realized I was sitting on this package a couple of years, ago, and I’ve been wanting to get a new version out. This week, I just did it. I ripped out all the legacy support for RFC 6415, upgraded the tests to use the Node test runner, switched from callback style to async/await, changed to ESM modules, and changed the format to StandardJS.

I also added a little utility method, so it’s easier to look up links in the JRD file that is returned. Now, to get an ActivityPub actor, you just do this:

const types = [
'application/activity+json',
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
]
const actorId = (await webfinger('user1@foo.example')).link('self', types)?.href

I think the dependencies are low enough that you can use this version of the library from browser apps, although I haven’t tried it yet.

Anyway, I published version 0.5.1 today. I hope it provides some value to other people working on Fediverse software.