Fedify: an ActivityPub server framework's avatar

Fedify: an ActivityPub server framework

@fedify@hollo.social ยท 9 following ยท 788 followers

:fedify: 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.

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

๐ŸŽ‰ Excited to announce that is now on Open Collective! Support the project's development starting at:

  • Backer (from $5/mo)
  • Supporter (from $25/mo)
  • Sponsor (from $100/mo)
  • Corporate Sponsor (from $500/mo)
  • Custom donations welcome

Your support will help us maintain and improve Fedify. Check it out here:

https://opencollective.com/fedify

:fedify:

Fedify's Open Collective page showing the project logo, description as โ€œA TypeScript library for building federated server apps powered by ActivityPub and other standardsโ€, and five contribution tiers starting from $5/month Backer to $500/month Corporate Sponsor, with custom contribution options available.
ALT text detailsFedify's Open Collective page showing the project logo, description as โ€œA TypeScript library for building federated server apps powered by ActivityPub and other standardsโ€, and five contribution tiers starting from $5/month Backer to $500/month Corporate Sponsor, with custom contribution options available.
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

Fedify is an server framework in & . 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.

The key features it provides currently are:

If you're curious, take a look at the website! There's comprehensive docs, a demo, a tutorial, example code, and more:

https://fedify.dev/

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

What other web frameworks would you like to see integrate with more?

OptionVoters
Koa4 (16%)
Fastify5 (20%)
Oak3 (12%)
Elysia3 (12%)
Next.js6 (24%)
Nuxt.js4 (16%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

What other web frameworks would you like to see integrate with more?

OptionVoters
Koa4 (16%)
Fastify5 (20%)
Oak3 (12%)
Elysia3 (12%)
Next.js6 (24%)
Nuxt.js4 (16%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

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 with :

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"));

https://github.com/dahlia/fedify-express

ๆดช ๆฐ‘ๆ†™ (Hong Minhee)'s avatar
ๆดช ๆฐ‘ๆ†™ (Hong Minhee)

@hongminhee@fosstodon.org

I'm unsure whether to adopt an emerging JavaScript runtime like or for 's tutorial, or stick with traditional .js. ๐Ÿค”

If I choose Bun/Deno, it comes with built-in 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.

OptionVoters
Bun0 (0%)
Deno0 (0%)
Node.js0 (0%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

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)'s avatar
ๆดช ๆฐ‘ๆ†™ (Hong Minhee)

@hongminhee@fosstodon.org

I ended up implementing the `fedify tunnel` command to eliminate the ngrok installation and sign-up part of the tutorial. ๐Ÿ˜‚

unstable.fedify.dev/cli#fedify

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

() ๊ฐœ๋ฐœ์„ ๋‹จ์ˆœํ™”ํ•  ์ค€๋น„๊ฐ€ ๋˜์…จ๋‚˜์š”? ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ํ™•์ธํ•ด๋ณด์„ธ์š”!

๋”์šฑ ์—ฐ๊ฒฐ๋œ, ๋”์šฑ ๋ถ„์‚ฐ๋œ ์›น์„ ๋งŒ๋“œ๋Š” ๋ฐ ๋™์ฐธํ•ด์ฃผ์„ธ์š”! ๐ŸŒ

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

ํ”„๋ ˆ์ž„์›Œํฌ๋Š” ์‹ค์ œ ์“ฐ์ž„์— ์ง‘์ค‘ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฌธ์„œ์—๋Š” ๊ฐ™์€ ์ฃผ์š” ๊ตฌํ˜„์ฒด๋“ค์ด ๋งŒ๋“  ์‚ฌ์‹ค์ƒ์˜ ํ‘œ์ค€์— ๋งž์ถ˜ ์–ดํœ˜ API ์‚ฌ์šฉ๋ฒ•์— ๋Œ€ํ•œ ๊ฐ€์ด๋“œ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋” ์ ์€ ๊ณ ๋ฏผ์œผ๋กœ ์ƒํ˜ธ ์šด์šฉ ๊ฐ€๋Šฅํ•œ ์•ฑ์„ ๋งŒ๋“œ์„ธ์š”! ๐Ÿค

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

์ธํ„ฐ๋ž™์…˜ ๋””๋ฒ„๊น…์€ ๊ฝค ๊นŒ๋‹ค๋กญ์ฃ . ๊ทธ๋ ‡์ง€๋งŒ ํˆด์ฒด์ธ์ด ๋„์™€๋“œ๋ฆฝ๋‹ˆ๋‹ค! ํ…Œ์ŠคํŠธ์™€ ๋””๋ฒ„๊น…์„ ์œ„ํ•œ CLI ํˆด์ฒด์ธ์„ ํฌํ•จํ•˜๊ณ  ์žˆ์–ด ๊ฐœ๋ฐœ๊ณผ ํŠธ๋Ÿฌ๋ธ”์ŠˆํŒ…์ด ์‰ฌ์›Œ์ง‘๋‹ˆ๋‹ค. ๋จธ๋ฆฌ ์‹ธ๋งค๋Š” ์‹œ๊ฐ„์„ ์ค„์ด๊ณ  ๋ฉ‹์ง„ ๊ธฐ๋Šฅ์„ ๋งŒ๋“œ๋Š” ๋ฐ ๋” ๋งŽ์€ ์‹œ๊ฐ„์„ ์“ฐ์„ธ์š”! ๐Ÿ”

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

ํ”„๋ ˆ์ž„์›Œํฌ๋Š” () ๊ฐœ๋ฐœ์— ์ค‘์š”ํ•œ ๊ธฐ๋Šฅ๋“ค์„ ๊ธฐ๋ณธ์œผ๋กœ ๋‚ด์žฅํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค:

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

์œ ์—ฐ์„ฑ์€ ์ค‘์š”ํ•˜์ฃ ! ํ”„๋ ˆ์ž„์›Œํฌ๋Š” ํ’€ ์Šคํƒ ์†”๋ฃจ์…˜์ด ์•„๋‹™๋‹ˆ๋‹คโ€”์—ฌ๋Ÿฌ๋ถ„์ด ์ข‹์•„ํ•˜๋Š” ์›น ํ”„๋ ˆ์ž„์›Œํฌ์™€ ํ•จ๊ป˜ ์ž‘๋™ํ•˜๋„๋ก ์„ค๊ณ„๋˜์—ˆ์ฃ . ๋ฐ ๋“ฑ, Fedify๋Š” ์—ฌ๋Ÿฌ ์›น ํ”„๋ ˆ์ž„์›Œํฌ์™€์˜ ์‰ฌ์šด ํ†ตํ•ฉ ์˜ต์…˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ๋ถ„๋งŒ์˜ ๋ฐฉ์‹์œผ๋กœ () ์•ฑ์„ ๋งŒ๋“œ์„ธ์š”! ๐Ÿ› ๏ธ

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

Fedify์˜ ๊ฐ€์žฅ ๊ฐ•๋ ฅํ•œ ๊ธฐ๋Šฅ ์ค‘ ํ•˜๋‚˜๋Š” ํƒ€์ž… ์•ˆ์ „ํ•œ ์–ดํœ˜ ๊ฐ์ฒด์ž…๋‹ˆ๋‹ค. ์ด๋Š” Activity Vocabulary์™€ ๋ฒค๋” ๋ณ„ ํ™•์žฅ์„ ํ‘œํ˜„ํ•˜๋Š”๋ฐ, ActivityPub ๊ฐ์ฒด์™€ ์•กํ‹ฐ๋น„ํ‹ฐ๋ฅผ ๋‹ค๋ฃฐ ๋•Œ ๊ฒฌ๊ณ ํ•˜๊ณ  ์•ˆ์ „ํ•œ ์ฝ”๋“œ๋ฅผ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค. ๋Ÿฐํƒ€์ž„ ์˜ค๋ฅ˜์™€ ์ž‘๋ณ„ํ•˜๊ณ  ์ž์‹  ์žˆ๋Š” ์ฝ”๋”ฉ์„ ์‹œ์ž‘ํ•˜์„ธ์š”! ๐Ÿ’ช๐Ÿผ

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

์†Œ๊ฐœ: () ์ƒ์— ์„œ๋ฒ„ ์•ฑ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•œ ๊ฐ•๋ ฅํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ! ๐Ÿš€

Fedify๋Š” ์—ฐํ•ฉํ˜• ์•ฑ์˜ ๋ณต์žกํ•จ์„ ๋‹จ์ˆœํ™”ํ•˜์—ฌ ๊ฐœ๋ฐœ์ž๊ฐ€ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ๊ฒƒโ€”๊ณ ์œ ํ•œ ๊ธฐ๋Šฅ๊ณผ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜โ€”์— ์ง‘์ค‘ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค. Fedify์˜ ํŠน์ง•์„ ์‚ดํŽด๋ณผ๊นŒ์š”? ๐Ÿงต

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

offers robust logging capabilities through integration with LogTape. This feature allows you to easily debug and monitor your Fedify app!

To enable , simply install the @logtape/logtape package and configure it in your app's entry point:

import { configure, getConsoleSink } from "@logtape/logtape";

await configure({
  sinks: { console: getConsoleSink() },
  filters: {},
  loggers: [
    { category: "your-app", sinks: ["console"], level: "debug" },
    { category: "fedify",   sinks: ["console"], level: "info" },
  ],
});

Fedify uses hierarchical categories for fine-grained control over log output. Key categories include ["fedify", "federation", "http"] for HTTP requests/responses and ["fedify", "federation", "inbox"]/["fedify", "federation", "outbox"] for incoming/outgoing activities. (There are more categories.)

With integration, you gain valuable insights into your Fedify app's behavior, making troubleshooting and optimization much more straightforward!

https://fedify.dev/manual/log

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

As a potential user, which of the following technologies are you familiar with?

OptionVoters
JavaScript17 (14%)
TypeScript13 (11%)
HTML & CSS18 (15%)
JSX (JavaScript XML) or TSX (TypeScript XML)10 (8%)
HTTP14 (11%)
ActivityPub8 (7%)
Node.js13 (11%)
Unix shell12 (10%)
SQL & relational databases14 (11%)
Digital signatures4 (3%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

If you read a , what software would you like to see as an in the tutorial?

OptionVoters
Microblog (like Mastodon)21 (32%)
Long-form blog (like WordPress)10 (15%)
Photo blog (like Pixelfed)7 (11%)
Forum (like NodeBB)6 (9%)
Link aggregator (like Lemmy)9 (14%)
Much simpler one!13 (20%)
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

If you read a , what software would you like to see as an in the tutorial?

OptionVoters
Microblog (like Mastodon)21 (32%)
Long-form blog (like WordPress)10 (15%)
Photo blog (like Pixelfed)7 (11%)
Forum (like NodeBB)6 (9%)
Link aggregator (like Lemmy)9 (14%)
Much simpler one!13 (20%)
ๆดช ๆฐ‘ๆ†™ (Hong Minhee)'s avatar
ๆดช ๆฐ‘ๆ†™ (Hong Minhee)

@hongminhee@fosstodon.org

A good issue to contribute to for the first time. Anybody interested?

github.com/dahlia/fedify/issue

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

, an server framework, has released v0.12.0. It's a minor release in about a month, so there's quite a few changes:

It's available on JSR and npm now, and you can upgrade it using the deno add command on Deno:

deno add @fedify/fedify@^0.12.0

Or using the bun add command on Bun:

bun add @fedify/fedify@^0.12.0

Or using the npm add command on Bun:

npm add @fedify/fedify@^0.12.0

John O'Nolan's avatar
John O'Nolan

@johnonolan@threads.net

I'm very excited to be successfully following our Ghost newsletter about building ActivityPub support, on Mastodon!

Photo by John O'Nolan on July 26, 2024. May be a video game screenshot of text.
ALT text detailsPhoto by John O'Nolan on July 26, 2024. May be a video game screenshot of text.
fedicat's avatar
fedicat

@fedicat@pc.cafe

More slow tinkering with , now have the actor dispatcher working and serving up my profile as seen from .

fediverse profile showing me working on a laptop on a sofa with a dog on each side
ALT text detailsfediverse profile showing me working on a laptop on a sofa with a dog on each side
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Matthias Bohlen's post

@admin Now fixed the stable docs too!

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

, an server framework, has released v0.12.0. It's a minor release in about a month, so there's quite a few changes:

It's available on JSR and npm now, and you can upgrade it using the deno add command on Deno:

deno add @fedify/fedify@^0.12.0

Or using the bun add command on Bun:

bun add @fedify/fedify@^0.12.0

Or using the npm add command on Bun:

npm add @fedify/fedify@^0.12.0

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

The Astro integration code has been reverted. It will come back in at some point once the blockers are resolved.

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

Since v0.12.0, when verifying HTTP Signatures or Object Integrity Proofs, it will cache the public keys once fetched. It is okay even if a cached key becomes outdated because a verification failure due to a cached key will invalidate the cache and force a verification retry.

This feature is available for preview in v0.12.0-dev.307+235629d5 (JSR or npm).

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Fedify: an ActivityPub server framework's post

Due to the details of the behavior of Astro's middleware, it looks like the next release (v0.12.0) may not be able to ship with the integration. ๐Ÿ˜…

ๆดช ๆฐ‘ๆ†™ (Hong Minhee)'s avatar
ๆดช ๆฐ‘ๆ†™ (Hong Minhee)

@hongminhee@fosstodon.org

Working on the `fedify init` command, the project setup wizard for โ€ฆ

A demo of the `fedify init` command. The JavaScript runtime choices are Deno, Node.js, and Bun, of which Deno is selected. The web framework choices are Bare-bones, Astro, Fresh, and Hono, with Hono selected. The key-value store options are No cache, Redis, and Deno KV, with Deno KV selected. The message queue options are No background jobs, Redis, Deno KV, and Deno KV is selected. Finally, an Hono project integrated with Fedify is created and the server is started by running the `deno task dev` command.
ALT text detailsA demo of the `fedify init` command. The JavaScript runtime choices are Deno, Node.js, and Bun, of which Deno is selected. The web framework choices are Bare-bones, Astro, Fresh, and Hono, with Hono selected. The key-value store options are No cache, Redis, and Deno KV, with Deno KV selected. The message queue options are No background jobs, Redis, Deno KV, and Deno KV is selected. Finally, an Hono project integrated with Fedify is created and the server is started by running the `deno task dev` command.
Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social

The fedify command is now available on ! You can install it using the following command:

npm install -g @fedify/cli

Or if you use :

bun install -g @fedify/cli

https://www.npmjs.com/package/@fedify/cli

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@fedify@hollo.social ยท Reply to Matthias Bohlen's post

@admin They are fixed in the unstable docs. For now, could you please use them instead? The stable docs will be fixed in the next release. Thanks!

https://unstable.fedify.dev/manual/federation

fedicat's avatar
fedicat

@fedicat@pc.cafe

finally getting to the part of my deno-fedify experiment, first thing working is the nodeinfo support

screenshot of web browser showing a debug view of JSON showing server info
ALT text detailsscreenshot of web browser showing a debug view of JSON showing server info
โ† Newer
Older โ†’