Fedify: an ActivityPub server framework
@[email protected] · 7 following · 374 followers
Fedify is a TypeScript library for building federated server apps powered by ActivityPub and other standards, so-called fediverse. It aims to eliminate the complexity and redundant boilerplate code when building a federated server app, so that you can focus on your business logic and user experience.
Website | GitHub | JSR | npm |
---|---|---|---|
洪 民憙 (Hong Minhee)
If you'd like to support the development of #Fedify or #Hollo, you can sponsor me on GitHub!
洪 民憙 (Hong Minhee)
This frustration later became the impetus for creating @fedify:
Fedify: an ActivityPub server framework
We've released v0.14.0 of #Fedify, the #ActivityPub server framework, with the following key changes:
- It is now possible to set the recipient of the
sendActivity()
method to"followers"
in just theContext
instead of theRequestContext
. - Improved performance of the
Object.toJsonLd()
method by about 3,000 times. - Added
source
property toObject
. - Added
aliases
property toActor
, corresponding to ActivityPub'salsoKnownAs
property. fedify init
command now adds defaultcompilerOptions
settings to tsconfig.json and deno.json.
Fedify v0.14.0 is available from JSR and npm. See also the full changelog for details.
Happy #fedidev!
Fedify: an ActivityPub server framework
@[email protected] · Reply to John Spurlock's post
We've added the Inspecting ActivityPub objects section to the #Fedify docs, introducing BrowserPub and the fedify lookup
command!
https://unstable.fedify.dev/manual/test#inspecting-activitypub-objects
Fedify: an ActivityPub server framework
@[email protected] · Reply to John Spurlock's post
We've added the Inspecting ActivityPub objects section to the #Fedify docs, introducing BrowserPub and the fedify lookup
command!
https://unstable.fedify.dev/manual/test#inspecting-activitypub-objects
Fedify: an ActivityPub server framework
Do you know that? Some of the properties in Activity Vocabulary have been renamed in #Fedify's JavaScript APIs. Below are some examples:
洪 民憙 (Hong Minhee)
@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post
Винт Прокс
@[email protected] · Reply to Йошильда :CrabVerified:'s post
Касаясь систем управления контентом с поддержкой #ActivityPub, хотелось бы отметить и библиотеку для построения собственного федеративного сервера @fedify. Отлично подходит, когда "все эти ваши вордпрессы мне нафиг не сдались". :blobcatmeltthumbsup:
洪 民憙 (Hong Minhee)
For educational purpose, I've created a federated microblog example using #Fedify, with a total of about 30 commits, which you can follow step by step.
Now, I'm starting to write a hands-on Fedify tutorial based on this example code. I'll make it public when I'm done!
洪 民憙 (Hong Minhee)
I've rewritten #Fedify several times and in several languages. The first time it was written in #TypeScript, then #Python, then C#, then back to TypeScript. (It was codenamed FediKit at the time of development.) I settled on TypeScript for the following reasons:
• It has a decent JSON-LD implementation.
• Lots of people use it. (I wanted Fedify to be widely used.)
• It's type-safe enough.
Even if I were to build Fedify again, I would choose TypeScript.
Fedify: an ActivityPub server framework
Fedify: an ActivityPub server framework
Security alert for Fedify users
We've patched a vulnerability in the getActorHandle()
function. Versions prior to 0.13.1 and 0.12.3 are affected.
Upgrade immediately:
Fedify: an ActivityPub server framework
In the next version (v0.14.0) of #Fedify, the performance of the Object.toJsonLd()
method will be dramatically (~3k ×) faster. This is expected to improve the overall performance of Fedify apps!
Fedify: an ActivityPub server framework
@[email protected] · Reply to Fedify: an ActivityPub server framework's post
Oh, and in the template for Deno, compilerOptions
is added to the deno.json file (if needed).
Fedify: an ActivityPub server framework
The next version of fedify init
will also generate a tsconfig.json file with decent default settings.
洪 民憙 (Hong Minhee)
I feel that the current abstraction level of #Fedify is not high enough which makes the tutorial lengthy, so I'm considering adding a higher-level API. One way would be to add a façade to the @fedify/fedify package, and another way would be to create a sort of metaframework as a separate package (e.g., @fedify/start?). Which way would be better?
Option | Voters |
---|---|
Façade | 0 (0%) |
Metaframework | 0 (0%) |
Fedify: an ActivityPub server framework
Fedify, the #ActivityPub server framework, has released v0.13.0. Key changes include:
- Added
fedify tunnel
command to expose the local server to the public internet. - Added Express and Nitro integration templates to the
fedify init
command. - Added option to skip HTTP Signatures validation for easier testing.
- Added
Question.closed
property. - Added
Question.voters
property. - Removed several deprecated APIs.
#Fedify v0.13.0 is available now from JSR and npm.
Fedify: an ActivityPub server framework
Option | Voters |
---|---|
Koa | 4 (16%) |
Fastify | 5 (20%) |
Oak | 3 (12%) |
Elysia | 3 (12%) |
Next.js | 6 (24%) |
Nuxt.js | 4 (16%) |
Fedify: an ActivityPub server framework
Option | Voters |
---|---|
Koa | 4 (16%) |
Fastify | 5 (20%) |
Oak | 3 (12%) |
Elysia | 3 (12%) |
Next.js | 6 (24%) |
Nuxt.js | 4 (16%) |
Fedify: an ActivityPub server framework
Introducing @fedify/express, a package that integrates Express, a popular web framework in Node.js, with Fedify. You can install it with the following command:
npm add @fedify/express
This package provides a middleware called integrateFederation()
that allows you to integrate #Fedify with #Express:
import express from "express";
import { integrateFederation } from "@fedify/express";
import { federation } from "./federation"; // Your `Federation` instance
export const app = express();
app.set("trust proxy", true);
app.use(integrateFederation(federation, (req) => "context data goes here"));
洪 民憙 (Hong Minhee)
I'm unsure whether to adopt an emerging JavaScript runtime like #Bun or #Deno for #Fedify's tutorial, or stick with traditional #Node.js. 🤔
If I choose Bun/Deno, it comes with built-in #TypeScript support, hot reloading, and a fetch-style HTTP server, so I don't have to explain much about it, but I need to deal with installing Bun/Deno itself.
On the other hand, Node.js can be assumed to be already installed on the reader's system, but they will need to set up TypeScript, hot reloading, etc.
Option | Voters |
---|---|
Bun | 0 (0%) |
Deno | 0 (0%) |
Node.js | 0 (0%) |
Fedify: an ActivityPub server framework
Starting with the next release, v0.13.0, the fedify tunnel
command will be added. The following command exposes a local HTTP server running on port 3000 to the public internet:
fedify tunnel 3000
https://unstable.fedify.dev/cli#fedify-tunnel-exposing-a-local-http-server-to-the-public-internet
洪 民憙 (Hong Minhee)
I ended up implementing the `fedify tunnel` command to eliminate the ngrok installation and sign-up part of the #Fedify tutorial. 😂
https://unstable.fedify.dev/cli#fedify-tunnel-exposing-a-local-http-server-to-the-public-internet
Fedify: an ActivityPub server framework
@[email protected] · Reply to Fedify: an ActivityPub server framework's post
#연합우주 (#fediverse) 개발을 단순화할 준비가 되셨나요? #Fedify 프레임워크를 확인해보세요!
더욱 연결된, 더욱 분산된 웹을 만드는 데 동참해주세요! 🌐 #ActivityPub
Fedify: an ActivityPub server framework
@[email protected] · Reply to Fedify: an ActivityPub server framework's post
#Fedify 프레임워크는 #ActivityPub의 실제 쓰임에 집중하고 있습니다. 문서에는 #Mastodon 같은 주요 구현체들이 만든 사실상의 표준에 맞춘 어휘 API 사용법에 대한 가이드가 포함되어 있습니다. 더 적은 고민으로 상호 운용 가능한 앱을 만드세요! 🤝
Fedify: an ActivityPub server framework
@[email protected] · Reply to Fedify: an ActivityPub server framework's post
#ActivityPub 인터랙션 디버깅은 꽤 까다롭죠. 그렇지만 #Fedify 툴체인이 도와드립니다! 테스트와 디버깅을 위한 CLI 툴체인을 포함하고 있어 개발과 트러블슈팅이 쉬워집니다. 머리 싸매는 시간을 줄이고 멋진 기능을 만드는 데 더 많은 시간을 쓰세요! 🔍
Fedify: an ActivityPub server framework
@[email protected] · Reply to Fedify: an ActivityPub server framework's post
#Fedify 프레임워크는 #연합우주 (#fediverse) 개발에 중요한 기능들을 기본으로 내장하고 있습니다:
- #WebFinger 클라이언트와 서버
- HTTP 서명 (HTTP Signatures)
- 객체 무결성 증명 (Object Integrity Proofs)
- NodeInfo 프로토콜
- 바퀴를 재발명할 필요 없어요—#ActivityPub 표준을 위한 핵심 기능을 갖추고 있습니다! 📦
Fedify: an ActivityPub server framework
@[email protected] · Reply to Fedify: an ActivityPub server framework's post
Fedify: an ActivityPub server framework
@[email protected] · Reply to Fedify: an ActivityPub server framework's post
Fedify의 가장 강력한 기능 중 하나는 타입 안전한 어휘 객체입니다. 이는 Activity Vocabulary와 벤더 별 확장을 표현하는데, ActivityPub 객체와 액티비티를 다룰 때 견고하고 안전한 코드를 보장합니다. 런타임 오류와 작별하고 자신 있는 코딩을 시작하세요! 💪🏼