Skip to main content

Fedify: Building ActivityPub servers without the pain

H.2215 (Ferrer) | Day 1 | 17:30 - 17:50 | Speakers: Hong Minhee

Fedify: Building ActivityPub servers without the pain
A picture of a devroom at FOSDEM 2024
Open in browser
Get involved in the conversation!Join the chat

Notes

Abstract

Implementing ActivityPub looks simple at first—it's just JSON over HTTP, right? Then you hit JSON-LD context resolution. Then HTTP Signature verification fails on Mastodon but works on Misskey. Then you realize the spec spans hundreds of pages across W3C documents and FEPs (Fediverse Enhancement Proposals), and every implementation interprets them differently.

I went through this pain building Hollo, a single-user microblogging server. Halfway through, I realized I was building a framework instead of an app. So I extracted that framework and called it Fedify.

Fedify is an opinionated ActivityPub framework for TypeScript. It handles the protocol plumbing so you can focus on your application logic.

In this talk, I'll cover:

  • Type-safe vocabulary: The Activity Vocabulary spec is loosely defined, but Fedify maps it to strict TypeScript types. Your IDE knows that Note.content is a LanguageString, and calling await create.getActor() returns an Actor object. No more guessing at property shapes.

  • Comprehensive signature support: Fedify implements four authentication mechanisms—HTTP Signatures (draft-cavage), HTTP Message Signatures (RFC 9421), Linked Data Signatures, and Object Integrity Proofs (FEP-8b32). For HTTP Signatures, it uses double-knocking: trying RFC 9421 first, falling back to draft-cavage if rejected, and remembering the preference. This kind of interoperability work is exactly what you shouldn't have to do yourself.

  • Framework-agnostic design: Fedify works as middleware for Hono, Express, Fastify, Next.js, or any framework that speaks Request/Response. Bring your own database, ORM, and auth—Fedify only needs a key–value store for caching.

  • CLI toolchain: The fedify inbox command spins up an ephemeral server to receive and inspect activities. fedify lookup fetches any ActivityPub object by URL or fediverse handle—including from servers that require authorized fetch. No need to create throwaway accounts on production instances.

I'll also share production stories: Ghost chose Fedify for federating their publishing platform rather than implementing the protocol themselves. Hollo demonstrates single-user microblogging with full Mastodon API compatibility. Hackers' Pub shows how a developer community can integrate with the fediverse.

Whether you're building a new federated service or adding ActivityPub to an existing app, this talk will show you how Fedify turns months of protocol wrangling into days of actual development.

Speakers

Hong Minhee

I'm Hong Minhee (note: Hong is the family name, as it's a Korean name), a software engineer from Seoul. I write some free/open source software, which are mostly written in Haskell, Python, and TypeScript. I'm an advocate of free/open source software and fediverse. My professional interests are decentralized peer-to-peer networks and statically typed functional programming languages.

I also have outside interests on etymology, East Asian languages (CJK), Chinese characters, and further, Unihan.

For a more detailed introduction, please visit my personal website at https://hongminhee.org/.


Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.