Skip to main content
This release is 17 versions behind 1.0.2 — 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
2 months ago (0.13.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 not persist messages.

c
MemoryKvStore

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

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 retriesstarts at the initialDelay and is multiplied by the factor for eachsubsequent retry, up to the maxDelay. The policy will give up aftermaxAttempts attempts. The actual delay is randomized to avoidsynchronization (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 acceptsJSON-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
Context

A context.

I
I
Federation

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

I
I
FederationKvPrefixes

Prefixes for namespacing keys in the Deno KV store.

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
ObjectCallbackSetters

Additional settings for an object dispatcher.

I
PageItems

A page of items.

I
RequestContext

A context for a request.

I
RetryContext

The context passed to a RetryPolicy callback.

I
RouterOptions

Options for the Router.

I
SendActivityOptions

Options for Context.sendActivity method andFederation.sendActivity method.

I
SenderKeyPair

A key pair for an actor who sends an activity.

Type Aliases

T
ActorDispatcher

A callback that dispatches an Actor object.

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