Fedify: an ActivityPub server framework
@fedify@hollo.social
Fetching remote #ActivityPub objects or actors often involves handling #WebFinger lookups, content negotiation, and then parsing potentially untyped JSON.
With #Fedify, it's much simpler: use Context.lookupObject()
. Pass it a URI (e.g., https://instance.tld/users/alice
) or a handle (e.g., @alice@instance.tld
), and Fedify handles the lookup and content negotiation automatically.
The real power comes from the return value: a type-safe Activity Vocabulary object, not just raw JSON. This allows you to confidently access properties and methods directly. For example, you can safely traverse account moves using .getSuccessor()
like this:
let actor = await ctx.lookupObject("@alice@instance.tld");
while (isActor(actor)) {
const successor = await actor.getSuccessor();
if (successor == null) break;
actor = successor;
}
// actor now holds the latest account after moves
This is readily available in handlers where the Context
object is provided (like actor dispatchers or inbox listeners).
Focus on your app's logic, not protocol boilerplate!
Learn more: https://fedify.dev/manual/context#looking-up-remote-objects