<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[webfinger package for NodeJS]]></title><description><![CDATA[<p>About 14 years ago, I created a <a href="https://www.npmjs.com/package/webfinger/">webfinger</a> package for NodeJS. At the time, NodeJS was only a few years old. I had created <a href="https://pumpio.org/">pump.io</a> as a new social networking engine and the successor to <a href="https://en.wikipedia.org/wiki/GNU_social">StatusNet</a>. I needed a client for webfinger lookup — the process of converting a <em>user@domain.tld</em> handle to a API endpoint for processing messages — and there wasn’t one for NodeJS, so I made it.</p><p>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, <a href="https://www.rfc-editor.org/info/rfc6415/">RFC 6415</a>, using XML for the data format. It also supported the (at that time) new Webfinger specification, <a href="https://www.rfc-editor.org/info/rfc7033/">RFC 7033</a>.</p><p>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.</p><p>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.</p><p>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:</p><div><div><div><pre><code><div>const types = [</div><div>  'application/activity+json',</div><div>  'application/ld+json; profile="<a href="https://www.w3.org/ns/activitystreams&quot;&amp;apos" rel="nofollow noopener noreferrer"><span>https://www.</span><span>w3.org/ns/activitystreams"&amp;apo</span><span>s</span></a>;</div><div>]</div><div></div><div>const actorId = (await webfinger('user1@foo.example')).link('self', types)?.href</div></code></pre></div></div></div><p>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.</p><p>Anyway, I published version <a href="https://www.npmjs.com/package/webfinger/v/0.5.1">0.5.1</a> today. I hope it provides some value to other people working on Fediverse software.</p>]]></description><link>https://citiverse.it/topic/87305f95-516f-4fee-a496-c4890dadb188/webfinger-package-for-nodejs</link><generator>RSS for Node</generator><lastBuildDate>Sat, 26 Sep 2026 02:34:31 GMT</lastBuildDate><atom:link href="https://citiverse.it/topic/87305f95-516f-4fee-a496-c4890dadb188.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Sep 2026 18:20:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to webfinger package for NodeJS on Fri, 25 Sep 2026 19:10:09 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://activitypub.space/user/evanprodromou%40socialwebfoundation.org" target="_blank" rel="noopener noreferrer nofollow ugc">@evanprodromou@socialwebfoundation.org</a> I was curious what your package does that mine doesn't, so I threw qwen at it. I've cut out much of the fluff, but the gist (feel free to skip it):</p>
<p dir="auto">&gt; ## What the package does that NodeBB doesn't<br />
&gt;<br />
&gt; - <strong><code>rel</code> query parameter</strong> — passes <code>rel</code> to the server for server-side link filtering (NodeBB always fetches all links and filters client-side).<br />
&gt; - <strong>First-class <code>aliases</code> and <code>properties</code></strong> accessors (NodeBB buries them in <code>_raw</code>).<br />
&gt; - <strong><code>link(rel, type)</code> selector</strong> with exact media-type matching (NodeBB filters inline with <code>assertAccept</code> substring matching).<br />
&gt; - <strong>Frozen/immutable</strong> result objects.<br />
&gt; - <strong>Zero dependencies</strong>, native <code>fetch</code>.<br />
&gt;<br />
&gt; ## What NodeBB does that the package doesn't<br />
&gt;<br />
&gt; - <strong>Caching</strong> (positive 24h, negative 10min) + split-domain cache-bypass under <code>strict</code>.<br />
&gt; - <strong>5s timeout.</strong><br />
&gt; - <strong>Content-type validation</strong> with an <code>application/octet-stream</code> → <code>JSON.parse</code> fallback for non-compliant servers (package just calls <code>res.json()</code> and throws).<br />
&gt; - <strong>Subject handling</strong>: fixes missing <code>acct:</code>/<code>did:</code> scheme, extracts <code>subjectHostname</code>, computes <code>splitDomain</code>.<br />
&gt; - <strong><code>strict</code> mode</strong> (rejects cross-domain subjects).<br />
&gt; - <strong><code>actorUri</code> extraction</strong> (rel=self filtered by accepted ActivityPub types) and <strong><code>publicKey</code></strong> extraction.<br />
&gt; - <strong><code>false</code>-on-failure</strong> semantics (callers do <code>result || {...}</code>).<br />
&gt; - <strong>Hostname round-trip validation</strong> (<code>new URL('https://'+host)/</code> check) and cache-key normalization.<br />
&gt;<br />
&gt; ## Latent bug in the package<br />
&gt;<br />
&gt; It uses <strong>static <code>URL.parse()</code></strong> for URL inputs — deprecated since Node 10 and slated for removal. It still works on this Node 23 build, but it's a ticking time-bomb on the Node versions it targets (22/24/26).</p>
<p dir="auto">It reads like NodeBB's webfinger parsing is more battle-tested because I've had to handle funky webfinger responses from slightly out-of-spec servers.</p>
<p dir="auto">There's potential for me to use your package as a low-level fetcher though.</p>
]]></description><link>https://citiverse.it/post/https://activitypub.space/post/2489</link><guid isPermaLink="true">https://citiverse.it/post/https://activitypub.space/post/2489</guid><dc:creator><![CDATA[julian@activitypub.space]]></dc:creator><pubDate>Fri, 25 Sep 2026 19:10:09 GMT</pubDate></item></channel></rss>