Skip to main content
Home
This release is 3 versions behind 1.5.3 — the latest version of @fedify/fedify. Jump to latest

@fedify/fedify@1.5.0-dev.718+37c51836
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
94%
Published
2 months ago (1.5.0-dev.718+37c51836)
interface CreateFederationOptions

Options for createFederation function.

Type Parameters

TContextData

The type of the context data.

Properties

The key-value store used for caching, outbox queues, and inbox idempotence.

Prefixes for namespacing keys in the Deno KV store. By default, all keys are prefixed with ["_fedify"].

The message queue for sending and receiving activities. If not provided, activities will not be queued and will be processed immediately.

If a MessageQueue is provided, both the inbox and outbox queues will be set to the same queue.

If a FederationQueueOptions object is provided, you can set the queues separately (since Fedify 1.3.0).

Whether to start the task queue manually or automatically.

If true, the task queue will not start automatically and you need to manually start it by calling the Federation.startQueue method.

If false, the task queue will start automatically as soon as the first task is enqueued.

By default, the queue starts automatically.

The canonical base URL of the server. This is used for constructing absolute URLs and fediverse handles.

optional
documentLoaderFactory: DocumentLoaderFactory

A custom JSON-LD document loader factory. By default, this uses the built-in cache-backed loader that fetches remote documents over HTTP(S).

optional
contextLoaderFactory: DocumentLoaderFactory

A custom JSON-LD context loader factory. By default, this uses the same loader as the document loader.

deprecated
optional
documentLoader: DocumentLoader

A custom JSON-LD document loader. By default, this uses the built-in cache-backed loader that fetches remote documents over HTTP(S).

deprecated
optional
contextLoader: DocumentLoader

A custom JSON-LD context loader. By default, this uses the same loader as the document loader.

optional
authenticatedDocumentLoaderFactory: AuthenticatedDocumentLoaderFactory

A factory function that creates an authenticated document loader for a given identity. This is used for fetching documents that require authentication.

Whether to allow fetching private network addresses in the document loader.

If turned on, CreateFederationOptions.documentLoader, CreateFederationOptions.contextLoader, and CreateFederationOptions.authenticatedDocumentLoaderFactory cannot be configured.

Mostly useful for testing purposes. Do not use in production.

Turned off by default.

optional
userAgent: GetUserAgentOptions | string

Options for making User-Agent strings for HTTP requests. If a string is provided, it is used as the User-Agent header. If an object is provided, it is passed to the getUserAgent function.

A callback that handles errors during outbox processing. Note that this callback can be called multiple times for the same activity, because the delivery is retried according to the backoff schedule until it succeeds or reaches the maximum retry count.

If any errors are thrown in this callback, they are ignored.

The time window for verifying HTTP Signatures of incoming requests. If the request is older or newer than this window, it is rejected. Or if it is false, the request's timestamp is not checked at all.

By default, the window is an hour.

Whether to skip HTTP Signatures verification for incoming activities. This is useful for testing purposes, but should not be used in production.

By default, this is false (i.e., signatures are verified).

The retry policy for sending activities to recipients' inboxes. By default, this uses an exponential backoff strategy with a maximum of 10 attempts and a maximum delay of 12 hours.

The retry policy for processing incoming activities. By default, this uses an exponential backoff strategy with a maximum of 10 attempts and a maximum delay of 12 hours.

optional
activityTransformers: readonly ActivityTransformer<TContextData>[]

Activity transformers that are applied to outgoing activities. It is useful for adjusting outgoing activities to satisfy some ActivityPub implementations.

By default, defaultActivityTransformers are applied.

Whether the router should be insensitive to trailing slashes in the URL paths. For example, if this option is true, /foo and /foo/ are treated as the same path. Turned off by default.

optional
tracerProvider: TracerProvider

The OpenTelemetry tracer provider for tracing operations. If not provided, the default global tracer provider is used.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/fedify

Import symbol

import { type CreateFederationOptions } from "@fedify/fedify/federation";
or

Import directly with a jsr specifier

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

Add Package

pnpm i jsr:@fedify/fedify
or (using pnpm 10.8 or older)
pnpm dlx jsr add @fedify/fedify

Import symbol

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

Add Package

yarn add jsr:@fedify/fedify
or (using Yarn 4.8 or older)
yarn dlx jsr add @fedify/fedify

Import symbol

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

Add Package

npx jsr add @fedify/fedify

Import symbol

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

Add Package

bunx jsr add @fedify/fedify

Import symbol

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