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

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 month ago (1.2.0)

The federated server framework.

Classes

c
InProcessMessageQueue

A message queue that processes messages in the same process. Do not use this in production as it does neither persist messages nor distribute them across multiple processes.

c
MemoryKvStore

A key-value store that stores values in memory. Do not use this in production as it does not persist values.

c
ParallelMessageQueue

A message queue that processes messages in parallel. It takes another MessageQueue, and processes messages in parallel up to a certain number of workers.

c
Router

URL router and constructor based on URI Template (RFC 6570).

c
RouterError

An error thrown by the Router.

Functions

f
createExponentialBackoffPolicy

Creates an exponential backoff retry policy. The delay between retries starts at the initialDelay and is multiplied by the factor for each subsequent retry, up to the maxDelay. The policy will give up after maxAttempts attempts. The actual delay is randomized to avoid synchronization (jitter).

f
createFederation

Create a new Federation instance.

f
respondWithObject

Responds with the given object in JSON-LD format.

f
respondWithObjectIfAcceptable

Responds with the given object in JSON-LD format if the request accepts JSON-LD.

Interfaces

I
ActorCallbackSetters

Additional settings for the actor dispatcher.

I
ActorKeyPair

A pair of a public key and a private key in various formats.

I
CollectionCallbackSetters

Additional settings for a collection dispatcher.

I
FederationKvPrefixes

Prefixes for namespacing keys in the Deno KV store.

I
InboxContext

A context for inbox listeners.

I
InboxListenerSetters

Registry for inbox listeners for different activity types.

I
KvStore

An abstract interface for a key-value store.

I
KvStoreSetOptions

Additional options for setting a value in a key-value store.

I
MessageQueue

An abstract interface for a message queue.

I
MessageQueueEnqueueOptions

Additional options for enqueuing a message in a queue.

I
MessageQueueListenOptions

Additional options for listening to a message queue.

I
ObjectCallbackSetters

Additional settings for an object dispatcher.

I
RetryContext

The context passed to a RetryPolicy callback.

I
SenderKeyPair

A key pair for an actor who sends an activity.

Type Aliases

T
ActorDispatcher

A callback that dispatches an Actor object.

T
ActorHandleMapper

A callback that maps a WebFinger username to the corresponding actor's internal identifier, or null if the username is not found.

T
ActorKeyPairsDispatcher

A callback that dispatches key pairs for an actor.

T
AuthorizePredicate

A callback that determines if a request is authorized or not.

T
CollectionCounter

A callback that counts the number of items in a collection.

T
CollectionCursor

A callback that returns a cursor for a collection.

T
CollectionDispatcher

A callback that dispatches a collection.

T
InboxErrorHandler

A callback that handles errors in an inbox.

T
InboxListener

A callback that listens for activities in an inbox.

T
KvKey

A key for a key-value store. An array of one or more strings.

T
NodeInfoDispatcher

A callback that dispatches a NodeInfo object.

T
ObjectAuthorizePredicate

A callback that determines if a request is authorized or not.

T
ObjectDispatcher

A callback that dispatches an object.

T
OutboxErrorHandler

A callback that handles errors during outbox processing.

T
ParseUriResult

A result of parsing an URI.

T
RetryPolicy

A policy that determines the delay before the next retry.

T
SharedInboxKeyDispatcher

A callback that dispatches the key pair for the authenticated document loader of the Context passed to the shared inbox listener.

Add Package

deno add jsr:@fedify/fedify

Import symbol

import * as mod from "@fedify/fedify/federation";

---- OR ----

Import directly with a jsr specifier

import * as mod from "jsr:@fedify/fedify/federation";

Add Package

npx jsr add @fedify/fedify

Import symbol

import * as mod from "@fedify/fedify/federation";

Add Package

yarn dlx jsr add @fedify/fedify

Import symbol

import * as mod from "@fedify/fedify/federation";

Add Package

pnpm dlx jsr add @fedify/fedify

Import symbol

import * as mod from "@fedify/fedify/federation";

Add Package

bunx jsr add @fedify/fedify

Import symbol

import * as mod from "@fedify/fedify/federation";