Fedify: Building ActivityPub servers without the pain - Slidev
"Implementing ActivityPub looks simple at first—it's just JSON over HTTP,\nright? Then you hit JSON-LD context resolution. Then HTTP Signature\nverification fails on Mastodon but works on Misskey. Then you realize\nthe spec spans hundreds of pages across W3C documents and [FEPs] (Fediverse\nEnhancement Proposals), and every implementation interprets them differently.\n\nI went through this pain building [Hollo], a single-user microblogging server.\nHalfway through, I realized I was building a framework instead of an app.\nSo I extracted that framework and called it Fedify.\n\n[Fedify] is an opinionated ActivityPub framework for TypeScript. It handles\nthe protocol plumbing so you can focus on your application logic.\n\nIn this talk, I'll cover:\n\n - *Type-safe vocabulary:* The Activity Vocabulary spec is loosely defined,\n but Fedify maps it to strict TypeScript types. Your IDE knows that\n `Note.content` is a `LanguageString`, and calling\n `await create.getActor()` returns an `Actor` object.\n No more guessing at property shapes.\n\n - *Comprehensive signature support:* Fedify implements four authentication\n mechanisms—HTTP Signatures (draft-cavage), HTTP Message Signatures (RFC\n 9421), Linked Data Signatures, and Object Integrity Proofs (FEP-8b32).\n For HTTP Signatures, it uses [double-knocking]: trying RFC 9421 first,\n falling back to draft-cavage if rejected, and remembering the preference.\n This kind of interoperability work is exactly what you shouldn't have to\n do yourself.\n\n - *Framework-agnostic design:* Fedify works as middleware for Hono, Express,\n Fastify, Next.js, or any framework that speaks `Request`/`Response`.\n Bring your own database, ORM, and auth—Fedify only needs a key–value store\n for caching.\n\n - *CLI toolchain:* The `fedify inbox` command spins up an ephemeral server\n to receive and inspect activities. `fedify lookup` fetches any ActivityPub\n object by URL or fediverse handle—including from servers that require\n [authorized fetch]. No need to create throwaway accounts on production\n instances.\n\nI'll also share production stories: [Ghost chose Fedify] for federating their\npublishing platform rather than implementing the protocol themselves. Hollo\ndemonstrates single-user microblogging with full Mastodon API compatibility.\n[Hackers' Pub] shows how a developer community can integrate with\nthe fediverse.\n\nWhether you're building a new federated service or adding ActivityPub to\nan existing app, this talk will show you how Fedify turns months of protocol\nwrangling into days of actual development.\n\n[FEPs]: https://w3id.org/fep/\n[Hollo]: https://docs.hollo.social/\n[Fedify]: https://fedify.dev/\n[double-knocking]: https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions\n[authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch\n[Ghost chose Fedify]: https://activitypub.ghost.org/day-4/\n[Hackers' Pub]: https://hackers.pub/\n"
hongminhee.codeberg.page