
Security News
Socket Releases Free Certified Patches for Nuxt Security Vulnerabilities
Socket releases free Certified Patches for high-severity Nuxt vulnerabilities, including server-side remote code execution through server island props.
@fedify/webfinger
Advanced tools
This package provides a WebFinger client implementation for looking up ActivityPub actors and other resources in the fediverse. It is part of the Fedify framework but can be used independently.
acct: URI schemedeno add jsr:@fedify/webfinger # Deno
npm add @fedify/webfinger # npm
pnpm add @fedify/webfinger # pnpm
yarn add @fedify/webfinger # Yarn
bun add @fedify/webfinger # Bun
You can look up a WebFinger resource using the lookupWebFinger() function:
import { lookupWebFinger } from "@fedify/webfinger";
// Look up by acct: URI
const result = await lookupWebFinger("acct:alice@example.com");
// Look up by URL
const result2 = await lookupWebFinger("https://example.com/users/alice");
The result is a ResourceDescriptor object containing the subject, aliases,
properties, and links:
import { lookupWebFinger } from "@fedify/webfinger";
const result = await lookupWebFinger("acct:alice@example.com");
if (result != null) {
console.log("Subject:", result.subject);
console.log("Aliases:", result.aliases);
// Find the ActivityPub actor URL
const actorLink = result.links?.find(
(link) => link.rel === "self" && link.type === "application/activity+json"
);
if (actorLink?.href != null) {
console.log("Actor URL:", actorLink.href);
}
}
The lookupWebFinger() function accepts various options:
import { lookupWebFinger } from "@fedify/webfinger";
const result = await lookupWebFinger("acct:alice@example.com", {
// Custom User-Agent header
userAgent: "MyApp/1.0",
// Maximum redirects to follow (default: 5)
maxRedirection: 3,
// AbortSignal for cancellation
signal: AbortSignal.timeout(5000),
});
lookupWebFinger(resource, options?): Looks up a WebFinger resource and
returns a ResourceDescriptor or null if not found.ResourceDescriptor: Describes a WebFinger resource with subject, aliases,
properties, and links.Link: Represents a link in a WebFinger response with relation type, media
type, href, titles, and properties.LookupWebFingerOptions: Options for the lookupWebFinger() function.For comprehensive documentation, please refer to:
FAQs
WebFinger client library for ActivityPub
The npm package @fedify/webfinger receives a total of 7,061 weekly downloads. As such, @fedify/webfinger popularity was classified as popular.
We found that @fedify/webfinger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket releases free Certified Patches for high-severity Nuxt vulnerabilities, including server-side remote code execution through server island props.

Security News
An open letter signed by 50 companies, from NVIDIA and Microsoft to Mistral and Hugging Face, urges Washington not to restrict open weight AI.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.