fedify

Implements ActivityPub federation servers in TypeScript using Fedify dispatchers and listeners.

1.0k|132|Updated Mar 2, 2024
One-click install
npx skills add https://github.com/fedify-dev/fedify --skill fedify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fedify
Source: https://github.com/fedify-dev/fedify/tree/main/claude-plugin/skills/fedify
Command: npx skills add https://github.com/fedify-dev/fedify --skill fedify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building a federated server that speaks ActivityPub involves HTTP Signatures, WebFinger, NodeInfo, JSON-LD vocabularies, delivery queues, and key management. This Skill guides the AI to write correct Fedify-based TypeScript code instead of hand-rolling protocol endpoints or misusing the framework's APIs.

Core Features & Use Cases

  • Federation Setup: Configures the Federation builder pattern, actor/inbox/outbox/collection dispatchers, and inbox listeners with correct URI templates and async semantics.
  • Framework Integration: Mounts Fedify through the correct @fedify/<framework> package for Hono, Express, Next.js, Nuxt, Fastify, Koa, NestJS, Astro, SvelteKit, Fresh, h3, Elysia, or Cloudflare Workers.
  • Production Hardening: Covers KvStore and MessageQueue adapters, key pair management, LogTape logging, OpenTelemetry tracing, the fedify CLI, and a checklist of common mistakes such as missing queues, SSRF guard disabling, and reverse-proxy origin issues.
  • Use Case: Ask the AI to scaffold a federated microblog on Hono with Postgres storage, and it will register actor dispatchers, wire inbox listeners for Follow and Create, and configure a production message queue.

Quick Start

Use the fedify skill to create an ActivityPub server with Hono that exposes an actor, an inbox handling Follow activities, and a Postgres-backed queue.

Frequently Asked Questions about fedify

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an ActivityPub server with Fedify?

Create a Federation object with createFederationBuilder or createFederation, register actor and inbox dispatchers, then mount it through the @fedify/<framework> integration package for your web framework. Fedify serves WebFinger and NodeInfo endpoints automatically.

How do I handle incoming Follow activities in Fedify?

Call setInboxListeners on the federation builder and chain .on(Follow, handler) to register a listener for that activity class. Activity types without a registered listener receive HTTP 202 and are logged as unsupported, so add a catch-all on the base Activity class if needed.

Does Fedify work with Express, Next.js, and Cloudflare Workers?

Yes, Fedify provides dedicated integration packages such as @fedify/express, @fedify/next, and @fedify/cfworkers, plus Hono, Fastify, Koa, NestJS, Nuxt, Astro, SvelteKit, Fresh, h3, and Elysia. On Cloudflare Workers, build the Federation inside the request handler using the builder pattern.

Why are my Fedify actor URLs using localhost instead of my domain?

Fedify reads request.url, so behind a reverse proxy or tunnel it mints URIs from the internal origin. Fix it by setting FederationOptions.origin to the canonical URL or by processing X-Forwarded headers with x-forwarded-fetch before requests reach Fedify.

What storage backends does Fedify support for production?

Fedify defines KvStore and MessageQueue interfaces with adapters for SQLite, Postgres, MySQL, Redis, AMQP, Deno KV, and Cloudflare Workers. MemoryKvStore is only suitable for development, and production deployments must configure a real queue for reliable outgoing delivery.