Skip to main content
This release is 0 versions behind 1.3.0 — the latest version of @fedify/fedify. Jump to latest

@fedify/fedify@1.3.0-dev.578+6bbdcb1d
Built and signed on GitHub Actions

An ActivityPub/fediverse server framework

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
a week ago (1.3.0-dev.578+6bbdcb1d)
interface Federation

An object that registers federation-related business logic and dispatches requests to the appropriate handlers.

It also provides a middleware interface for handling requests before your web framework's router; see Federation.fetch.

Type Parameters

TContextData

Methods

Manually start the task queue.

This method is useful when you set the manuallyStartQueue option to true in the createFederation function.

Create a new context.

Create a new context for a request.

Registers a NodeInfo dispatcher.

Registers an actor dispatcher.

setObjectDispatcher<
TObject extends Object,
TParam extends string,
>
(
cls: (new (...args: any[]) => TObject) & { typeId: URL; },
path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`,
dispatcher: ObjectDispatcher<TContextData, TObject, TParam>,
): ObjectCallbackSetters<TContextData, TObject, TParam>

Registers an object dispatcher.

setObjectDispatcher<
TObject extends Object,
TParam extends string,
>
(
cls: (new (...args: any[]) => TObject) & { typeId: URL; },
path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`,
dispatcher: ObjectDispatcher<TContextData, TObject, TParam>,
): ObjectCallbackSetters<TContextData, TObject, TParam>

Registers an object dispatcher.

setObjectDispatcher<
TObject extends Object,
TParam extends string,
>
(
cls: (new (...args: any[]) => TObject) & { typeId: URL; },
path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`,
dispatcher: ObjectDispatcher<TContextData, TObject, TParam>,
): ObjectCallbackSetters<TContextData, TObject, TParam>

Registers an object dispatcher.

setObjectDispatcher<
TObject extends Object,
TParam extends string,
>
(
cls: (new (...args: any[]) => TObject) & { typeId: URL; },
path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`,
dispatcher: ObjectDispatcher<TContextData, TObject, TParam>,
): ObjectCallbackSetters<TContextData, TObject, TParam>

Registers an object dispatcher.

setObjectDispatcher<
TObject extends Object,
TParam extends string,
>
(
cls: (new (...args: any[]) => TObject) & { typeId: URL; },
path: `${string}{${TParam}}${string}{${TParam}}${string}`,
dispatcher: ObjectDispatcher<TContextData, TObject, TParam>,
): ObjectCallbackSetters<TContextData, TObject, TParam>

Registers an object dispatcher.

setObjectDispatcher<
TObject extends Object,
TParam extends string,
>
(
cls: (new (...args: any[]) => TObject) & { typeId: URL; },
path: `${string}{${TParam}}${string}`,
dispatcher: ObjectDispatcher<TContextData, TObject, TParam>,
): ObjectCallbackSetters<TContextData, TObject, TParam>

Registers an object dispatcher.

Registers an inbox dispatcher.

Registers an outbox dispatcher.

Registers a following collection dispatcher.

Registers a followers collection dispatcher.

Registers a liked collection dispatcher.

Registers a featured collection dispatcher.

Registers a featured tags collection dispatcher.

setInboxListeners(
inboxPath: `${string}{identifier}${string}` | `${string}{handle}${string}`,
sharedInboxPath?: string,
): InboxListenerSetters<TContextData>

Assigns the URL path for the inbox and starts setting inbox listeners.

Handles a request related to federation. If a request is not related to federation, the onNotFound or onNotAcceptable callback is called.

Usually, this method is called from a server's request handler or a web framework's middleware.

Add Package

deno add jsr:@fedify/fedify

Import symbol

import { type Federation } from "@fedify/fedify/federation";

---- OR ----

Import directly with a jsr specifier

import { type Federation } from "jsr:@fedify/fedify/federation";

Add Package

npx jsr add @fedify/fedify

Import symbol

import { type Federation } from "@fedify/fedify/federation";

Add Package

yarn dlx jsr add @fedify/fedify

Import symbol

import { type Federation } from "@fedify/fedify/federation";

Add Package

pnpm dlx jsr add @fedify/fedify

Import symbol

import { type Federation } from "@fedify/fedify/federation";

Add Package

bunx jsr add @fedify/fedify

Import symbol

import { type Federation } from "@fedify/fedify/federation";