Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
An ActivityPub/fediverse server framework
Classes
Tracks reachability state for remote outbox delivery hosts.
- beforeSend(): Promise<CircuitBreakerBeforeSendDecision>remoteHost: string,message: { readonly circuitHeldSince?: string; }No documentation available
- capHeldDelay(): Temporal.DurationheldSince: Temporal.Instant,delay: Temporal.DurationNo documentation available
- dropActivity(): Promise<void>remoteHost: string,details: CircuitBreakerActivityDropNo documentation available
- getState(remoteHost: string): Promise<CircuitBreakerKvState | undefined>No documentation available
- options(): NormalizedCircuitBreakerOptionsNo documentation available
- pendingSweep(): Promise<void> | undefined
The currently running background legacy sweep, if any.
- recordFailure(remoteHost: string): Promise<CircuitBreakerStateChange | undefined>No documentation available
- recordReachableFailure(remoteHost: string): Promise<CircuitBreakerStateChange | undefined>No documentation available
- recordSuccess(remoteHost: string): Promise<CircuitBreakerStateChange | undefined>No documentation available
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.
- enqueue(): Promise<void>message: any,options?: MessageQueueEnqueueOptions
Enqueues a message in the queue.
- enqueueMany(): Promise<void>messages: readonly any[],options?: MessageQueueEnqueueOptions
Enqueues multiple messages in the queue. This operation is optional, and may not be supported by all implementations. If not supported, Fedify will invoke enqueue for each message. An implementation that may accept only part of a batch before rejecting must declare atomicEnqueueMany
false. - getDepth(): Promise<MessageQueueDepth>
Gets the number of messages waiting in the queue.
- listen(): Promise<void>handler: (message: any) => Promise<void> | void,options?: MessageQueueListenOptions
Listens for messages in the queue.
- nativeDeduplication: boolean
In-process message queue does not deduplicate messages natively.
- nativeRetrial: boolean
In-process message queue does not provide native retry mechanisms.
A key–value store that stores values in memory. Do not use this in production as it does not persist values.
- cas(): Promise<boolean>key: KvKey,expectedValue: unknown,newValue: unknown,options?: KvStoreSetOptions
{@inheritDoc KvStore.cas}
- delete(key: KvKey): Promise<void>
{@inheritDoc KvStore.delete}
- get<T = unknown>(key: KvKey): Promise<T | undefined>
{@inheritDoc KvStore.get}
- list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>
{@inheritDoc KvStore.list}
- set(): Promise<void>key: KvKey,value: unknown,options?: KvStoreSetOptions
{@inheritDoc KvStore.set}
A message queue that processes messages in parallel. It takes another MessageQueue, and processes messages in parallel up to a certain number of workers.
- atomicEnqueueMany: boolean
Inherits the atomic batch capability from the wrapped queue.
- enqueue(): Promise<void>message: any,options?: MessageQueueEnqueueOptions
Enqueues a message in the queue.
- enqueueMany(): Promise<void>messages: readonly any[],options?: MessageQueueEnqueueOptions
Enqueues multiple messages in the queue. This operation is optional, and may not be supported by all implementations. If not supported, Fedify will invoke enqueue for each message. An implementation that may accept only part of a batch before rejecting must declare atomicEnqueueMany
false. - getDepth: () => Promise<MessageQueueDepth>
Gets the number of messages waiting in the queue.
- listen(): Promise<void>handler: (message: any) => Promise<void> | void,options?: MessageQueueListenOptions
Listens for messages in the queue.
- nativeDeduplication: boolean
Inherits the native deduplication capability from the wrapped queue.
- nativeRetrial: boolean
Inherits the native retry capability from the wrapped queue.
- queue: MessageQueueNo documentation available
- workers: numberNo documentation available
An error that is thrown when an activity fails to send to a remote inbox. It contains structured information about the failure, including the HTTP status code, the inbox URL, and the response body.
- inbox: URL
The inbox URL that the activity was being sent to.
- responseBody: string
The response body from the inbox, if any. Note that this may be truncated to a maximum of 1 KiB to prevent excessive memory consumption when remote servers return large error pages (e.g., Cloudflare error pages). If truncated, the string will end with
"… (truncated)". - responseHeaders: Headers
The response headers from the inbox.
- statusCode: number
The HTTP status code returned by the inbox.
- add(): Set<string>template: string,name: string
Adds a new path rule to the router.
- build(): string | nullname: string,values: Record<string, string>
Constructs a URL/path from a path name and values.
- clone(): Router
Clones this router.
- has(name: string): boolean
Checks if a path name exists in the router.
- route(url: string): RouterRouteResult | null
Resolves a path name and values from a URL, if any match.
- trailingSlashInsensitive(): boolean
Whether to ignore trailing slashes when matching paths.
An error thrown by the Router.
Functions
An activity transformer that dehydrates the actor property of an activity so that it only contains the actor's URI. For example, suppose we have an activity like this:
Attaches a LD signature to the given JSON-LD document.
An activity transformer that assigns a new random ID to an activity if it does not already have one. This is useful for ensuring that activities have an ID before they are sent to other servers.
Builds Collection-Synchronization header content.
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).
Create a new Federation instance.
Creates a new FederationBuilder instance.
Creates a proof for the given object.
Creates a LD signature for the given JSON-LD document.
Detaches Linked Data Signatures from the given JSON-LD document.
Calculates the partial follower collection digest.
Checks if the actor of the given activity owns the specified key.
Exports a key in JWK format.
Fetches a CryptographicKey or Multikey from the given URL.
If the given URL contains an Actor object, it tries to find
the corresponding key in the publicKey or assertionMethod property. *
Gateway keys of FEP-ef61 portable actors, i.e., keys whose IDs are
compatible identifiers that dereference to portable actor documents, are
not resolved by this function, as they only authenticate HTTP requests;
use verifyRequest() or getKeyOwner() for them instead. Nor are keys
of portable actors whose IDs are ap: or ap+ef61: URIs, for the same
reason. Keys whose IDs are compatible identifiers or ap: or ap+ef61:
URIs are never read from or written to the key cache under their IDs,
except for failures to fetch them.
Fetches a CryptographicKey or Multikey from the given URL,
preserving transport-level fetch failures for callers that need to inspect
why the key could not be loaded. *
Gateway keys of FEP-ef61 portable actors, i.e., keys whose IDs are
compatible identifiers that dereference to portable actor documents, are
not resolved by this function, as they only authenticate HTTP requests;
use verifyRequest() or getKeyOwner() for them instead. Nor are keys
of portable actors whose IDs are ap: or ap+ef61: URIs, for the same
reason. Keys whose IDs are compatible identifiers or ap: or ap+ef61:
URIs are never read from or written to the key cache under their IDs,
except for failures to fetch them.
Serializes an array of AcceptSignatureMember objects into an
Accept-Signature header value string (RFC 9421 §5.1).
Attempts to translate an AcceptSignatureMember challenge into RFC 9421 signing options that the local signer can fulfill.
Generates a key pair which is appropriate for Fedify.
Gets an authenticated DocumentLoader for the given identity. Note that an authenticated document loader intentionally does not cache the fetched documents. At most 20 HTTP redirects and alternate document links are followed in total per call. Revisiting a URL within that chain throws a FetchError. Each call, including its double-knocking retries, times out after 10 seconds by default; see DocumentLoaderFactoryOptions.timeout.
Gets the default activity transformers that are applied to all outgoing activities.
Gets the actor that owns the specified key. Returns null if the key has no
known owner.
Fetches a NodeInfo document from the given URL.
Handles a WebFinger request. You would not typically call this function directly, but instead use Federation.fetch method.
Checks if the given JSON-LD document has a DataIntegrityProof-like object, without fully deserializing it into vocabulary classes.
Checks if the given JSON-LD document has a Linked Data Signature-like object, without restricting it to a single suite-specific shape.
Imports a key from JWK format.
Converts a NodeInfo object to a JSON value.
Normalizes user-provided circuit breaker options into the internal policy shape used while processing queued outbox deliveries.
Parses an Accept-Signature header value (RFC 9421 §5.1) into an
array of AcceptSignatureMember objects.
Parses a value loaded from the circuit breaker KV store.
Parses a NodeInfo document.
Responds with the given object in JSON-LD format.
Responds with the given object in JSON-LD format if the request accepts JSON-LD.
Signs the given JSON-LD document with the private key and returns the signed JSON-LD document.
Signs the given object with the private key and returns the signed object.
Signs a request using the given private key.
Filters out AcceptSignatureMember entries whose covered
components include response-only identifiers (@status) that are
not applicable to request-target messages, as required by
RFC 9421 §5.
Verify the authenticity of the given JSON-LD document using Linked Data
Signatures. If the document is signed, this function verifies the signature
and checks if the document is attributed to the owner of the public key.
If the document is not signed, this function returns false.
& { fromJsonLd(
Verifies the given object. It will verify all the proofs in the object, and succeed only if all the proofs are valid and all attributions and actors are authenticated by the proofs.
Applies the FEP-ef61 trust policy to a portable object fetched through a gateway.
Verifies the FEP-ef61 Object Integrity Proof policy for a portable object.
Verifies the given proof for the object.
Verifies the signature of a request.
Verifies the signature of a request and returns a structured failure reason when verification does not succeed.
Verifies Linked Data Signatures of the given JSON-LD document.
Interfaces
Represents a single member of the Accept-Signature Dictionary
Structured Field, as defined in
RFC 9421 §5.1.
- components: AcceptSignatureComponent[]
The exact list of covered component identifiers requested for the target signature, including all applicable component parameters, as required by RFC 9421 §5.1.
- label: string
The label that uniquely identifies the requested message signature within the context of the target HTTP message (e.g.,
"sig1"). - parameters: AcceptSignatureParameters
Optional signature metadata parameters requested by the verifier.
Signature metadata parameters that may appear in an
Accept-Signature member, as defined in
RFC 9421 §5.1.
- alg: string
If present, the signer is requested to use the indicated algorithm from the HTTP Signature Algorithms registry.
- created: true
If
true, the signer is requested to generate and include a creation timestamp. This parameter has no associated value in the wire format. - expires: true
If
true, the signer is requested to generate and include an expiration timestamp. This parameter has no associated value in the wire format. - keyid: string
If present, the signer is requested to use the indicated key material to create the target signature.
- nonce: string
If present, the signer is requested to include this value as the signature nonce in the target signature.
- tag: string
If present, the signer is requested to include this value as the signature tag in the target signature.
Additional settings for the actor dispatcher.
- authorize(predicate: AuthorizePredicate<TContextData>): ActorCallbackSetters<TContextData>
Specifies the conditions under which requests are authorized.
- mapActorAlias(): ActorCallbackSetters<TContextData>path: `/${string}`,identifier: string
Maps a fixed path to a sentinel identifier. It is useful for exposing a single, instance-level actor at a fixed path, such as
/actorfor a relay or/botfor a bot. - mapAlias(mapper: ActorAliasMapper<TContextData>): ActorCallbackSetters<TContextData>
Sets the callback function that maps a WebFinger query to the corresponding actor's identifier or username. If it's omitted, the WebFinger handler only supports the actor URIs and
acct:URIs. If you want to support other queries, you should set this dispatcher. - mapHandle(mapper: ActorHandleMapper<TContextData>): ActorCallbackSetters<TContextData>
Sets the callback function that maps a WebFinger username to the corresponding actor's identifier. If it's omitted, the identifier is assumed to be the same as the WebFinger username, which makes your actors have the immutable handles. If you want to let your actors change their fediverse handles, you should set this dispatcher.
- mapPortableActorId(mapper: PortableActorIdMapper<TContextData>): ActorCallbackSetters<TContextData>
Sets the callback function that maps an actor's identifier to the ID of the FEP-ef61 portable actor it dispatches. If the callback returns a portable ID for an identifier, the key pairs of that actor are treated as this server's gateway keys for the portable actor: Context.getActorKeyPairs derives their key IDs from the actor's compatible identifier on this server, e.g.,
https://example.com/.well-known/apgateway/did:key:z6Mk.../actors/alice#main-key, and makes the portable actor their owner, so that requests this server makes on behalf of the actor, such as activity deliveries and signed fetches, are signed with them. Gateway keys are only used for HTTP Signatures; they never make Object Integrity Proofs or Linked Data Signatures. - setKeyPairsDispatcher(dispatcher: ActorKeyPairsDispatcher<TContextData>): ActorCallbackSetters<TContextData>
Sets the key pairs dispatcher for actors.
A pair of a public key and a private key in various formats.
- cryptographicKey: CryptographicKey
A CryptographicKey instance of the public key.
- keyId: URL
The URI of the public key for CryptographicKey, which is used for verifying HTTP Signatures and Linked Data Signatures. Note that this is the ID of the cryptographicKey, not of the multikey; the Multikey instance has a distinct ID of its own.
- multikey: Multikey
A Multikey instance of the public key.
Details passed to CircuitBreakerOptions.onActivityDrop when a held activity expires before the remote host recovers.
- activity: Activity
The activity that was dropped.
- activityId: string
The activity ID, when known.
- activityType: string
The activity type.
- actorIds: readonly URL[]
The actor IDs represented by this inbox.
- heldSince: Temporal.Instant
The time when Fedify first held this activity.
- inbox: URL
The inbox URL that would have received the activity.
The JSON-serializable state stored in the configured KvStore.
- failures: readonly string[]No documentation available
- halfOpened: stringNo documentation available
- opened: stringNo documentation available
- state: CircuitBreakerStateNo documentation available
A circuit breaker state transition.
- newState: CircuitBreakerStateNo documentation available
- previousState: CircuitBreakerStateNo documentation available
Additional settings for a collection dispatcher.
- authorize(predicate: AuthorizePredicate<TContextData>): CollectionCallbackSetters<TContext, TContextData, TFilter>
Specifies the conditions under which requests are authorized.
- setCounter(counter: CollectionCounter<TContextData, TFilter>): CollectionCallbackSetters<TContext, TContextData, TFilter>
Sets the counter for the collection.
- setFirstCursor(cursor: CollectionCursor<TContext, TContextData, TFilter>): CollectionCallbackSetters<TContext, TContextData, TFilter>
Sets the first cursor for the collection.
- setLastCursor(cursor: CollectionCursor<TContext, TContextData, TFilter>): CollectionCallbackSetters<TContext, TContextData, TFilter>
Sets the last cursor for the collection.
A context.
- canonicalOrigin: string
The canonical origin of the federated server, including the scheme (
http://orhttps://) and the host (e.g.,example.com:8080). - clone(data: TContextData): Context<TContextData>
Creates a new context with the same properties as this one, but with the given data.
- contextLoader: DocumentLoader
The context loader for loading remote JSON-LD contexts.
- data: TContextData
The user-defined data associated with the context.
- documentLoader: DocumentLoader
The document loader for loading remote JSON-LD documents.
- enqueueTask<TData>(): Promise<void>task: TaskDefinition<TContextData, TData>,data: TData,options?: TaskEnqueueOptions
Enqueues a custom background task. The payload is validated against the task's schema, serialized, and processed by the task's handler on a background worker.
- enqueueTaskMany<TData>(): Promise<void>task: TaskDefinition<TContextData, TData>,payloads: readonly TData[],options?: TaskEnqueueOptions
Enqueues multiple payloads for a custom background task at once. Uses the queue's bulk enqueue operation when available. Without deduplication, it may fall back to parallel single enqueues when the queue does not implement bulk enqueue.
- federation: Federation<TContextData>
The federation object that this context belongs to.
- getActorKeyPairs(identifier: string): Promise<ActorKeyPair[]>
Gets the key pairs for an actor.
- getActorUri(identifier: string): URL
Builds the URI of an actor with the given identifier.
- getCollectionUri<TParam extends Record<string, string>>(): URLname: string | symbol,values: TParam
Builds the URI of a collection of objects with the given name and values.
- getDocumentLoader(identity: { identifier: string; } | { username: string; }): Promise<DocumentLoader>
Gets an authenticated DocumentLoader for the given identity. Note that an authenticated document loader intentionally does not cache the fetched documents.
- getFeaturedTagsUri(identifier: string): URL
Builds the URI of an actor's featured tags collection with the given identifier.
- getFeaturedUri(identifier: string): URL
Builds the URI of an actor's featured collection with the given identifier.
- getFollowersUri(identifier: string): URL
Builds the URI of an actor's followers collection with the given identifier.
- getFollowingUri(identifier: string): URL
Builds the URI of an actor's following collection with the given identifier.
- getInboxUri(): URL
Builds the URI of the shared inbox.
- getLikedUri(identifier: string): URL
Builds the URI of an actor's liked collection with the given identifier.
- getMediaUploaderUri(identifier: string): URL
Builds the URI of an actor's media upload endpoint with the given identifier. This is the endpoint advertised under
endpoints.uploadMediain the actor document. - getNodeInfoUri(): URL
Builds the URI of the NodeInfo document.
- getObjectUri<TObject extends Object>(): URLcls: ConstructorWithTypeId<TObject>,values: Record<string, string>
Builds the URI of an object with the given class and values.
- getOutboxUri(identifier: string): URL
Builds the URI of an actor's outbox with the given identifier.
- getPortableActorUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor with the given identifier under the given DID authority.
- getPortableCollectionUri<TParam extends Record<string, string>>(): URLname: string | symbol,values: TParam,authority: string
Builds the FEP-ef61 portable ID of a custom collection with the given name and values under the given DID authority.
- getPortableFeaturedTagsUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor's featured tags collection with the given identifier under the given DID authority.
- getPortableFeaturedUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor's featured collection with the given identifier under the given DID authority.
- getPortableFollowersUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor's followers collection with the given identifier under the given DID authority.
- getPortableFollowingUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor's following collection with the given identifier under the given DID authority.
- getPortableInboxUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor's inbox with the given identifier under the given DID authority.
- getPortableLikedUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor's liked collection with the given identifier under the given DID authority.
- getPortableObjectUri<TObject extends Object>(): URLcls: ConstructorWithTypeId<TObject>,values: Record<string, string>,authority: string
Builds the FEP-ef61 portable ID of an object with the given class and values under the given DID authority.
- getPortableOutboxUri(): URLidentifier: string,authority: string
Builds the FEP-ef61 portable ID of an actor's outbox with the given identifier under the given DID authority.
- host: string
The host of the federated server, including the hostname (e.g.,
example.com) and the port following a colon (e.g.,:8080) if it is not the default port for the scheme. - hostname: string
The hostname of the federated server (e.g.,
example.com). This is the same as the host without the port. - lookupNodeInfo(): Promise<NodeInfo | undefined>url: URL | string,options?: GetNodeInfoOptions & { parse?: "strict" | "best-effort"; }
Fetches the NodeInfo document from the given URL.
- lookupObject(): Promise<Object | null>identifier: string | URL,options?: LookupObjectOptions
Looks up an ActivityStreams object by its URI (including
acct:URIs) or a fediverse handle (e.g.,@user@serveroruser@server). - lookupWebFinger(): Promise<ResourceDescriptor | null>resource: URL | string,options?: LookupWebFingerOptions
Looks up a WebFinger resource.
- meterProvider: MeterProvider
The OpenTelemetry meter provider.
- origin: string
The origin of the federated server, including the scheme (
http://orhttps://) and the host (e.g.,example.com:8080). - parseUri(): ParseUriResult | nulluri: URL | null,options?: ParseUriOptions
Determines the type of the URI and extracts the associated data.
- routeActivity(): Promise<boolean>recipient: string | null,activity: Activity,options?: RouteActivityOptions
Manually routes an activity to the appropriate inbox listener.
- sendActivity(): Promise<void>sender:SenderKeyPair
| SenderKeyPair[]
| { identifier: string; }
| { username: string; },recipients: Recipient | Recipient[],activity: Activity,options?: SendActivityOptionsSends an activity to recipients' inboxes.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider.
- traverseCollection(): AsyncIterable<Object | Link>collection: Collection,options?: TraverseCollectionOptions
Traverses a collection, yielding each item in the collection. If the collection is paginated, it will fetch the next page automatically.
- verifyPortableObject: PortableObjectVerifier
The FEP-ef61 portable object policy that this context applies to portable objects it dereferences. It is
verifyPortableObject()with this context's document loader, context loader, and tracer provider as defaults, which the options passed to it override.
Options for createExponentialBackoffPolicy function.
- factor: number
The factor to multiply the previous delay by for each retry. Defaults to 2.
- initialDelay: Temporal.DurationLike
The initial delay before the first retry. Defaults to 1 second.
- jitter: boolean
Whether to add jitter to the delay to avoid synchronization. Turned on by default.
- maxAttempts: number
The maximum number of attempts before giving up. Defaults to 10.
- maxDelay: Temporal.DurationLike
The maximum delay between retries. Defaults to 12 hours.
Options for createProof.
- context:string
| Record<string, string>
| (string | Record<string, string>)[]The JSON-LD context to use for serializing the object to sign.
- contextLoader: DocumentLoader
The context loader for loading remote JSON-LD contexts.
- created: Temporal.Instant
The time when the proof was created. If not specified, the current time will be used.
Options for creating Linked Data Signatures.
- contextLoader: DocumentLoader
The context loader for loading remote JSON-LD contexts.
- created: Temporal.Instant
The time when the signature was created. If not specified, the current time will be used.
Additional settings for a custom collection dispatcher.
- authorize(predicate: ObjectAuthorizePredicate<TContextData, string>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>
Specifies the conditions under which requests are authorized.
- mapPortableOwner(mapper: PortableCollectionOwnerMapper<TContextData, TParam>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>
Maps the custom collection to the actor that owns it, so that it is also served as an FEP-ef61 portable collection through the gateway endpoint, e.g.,
GET /.well-known/apgateway/did:key:z6Mk.../users/alice/bookmarks, if the owner is a portable actor under the requested DID. Without it, the custom collection is not served through the gateway endpoint. - setCounter(counter: CustomCollectionCounter<TParam, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>
Sets the counter for the custom collection.
- setFirstCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>
Sets the first cursor for the custom collection.
- setLastCursor(cursor: CustomCollectionCursor<TParam, TContext, TContextData>): CustomCollectionCallbackSetters<TParam, TContext, TContextData>
Sets the last cursor for the custom collection.
Options for doesActorOwnKey.
- contextLoader: DocumentLoader
The context loader to use for JSON-LD context retrieval.
- documentLoader: DocumentLoader
The document loader to use for fetching the actor.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider to use for tracing. If omitted, the global tracer provider is used.
A common interface between Federation and FederationBuilder.
- setActorDispatcher(): ActorCallbackSetters<TContextData>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: ActorDispatcher<TContextData>
Registers an actor dispatcher.
- setCollectionDispatcher<TObject extends Object, TParam extends string>(): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>name: string | symbol,itemType: ConstructorWithTypeId<TObject>,path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`,dispatcher: CustomCollectionDispatcher<>TObject,TParam,RequestContext<TContextData>,TContextData
Registers a collection of objects dispatcher.
- setFeaturedDispatcher(): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: CollectionDispatcher<Object, RequestContext<TContextData>, TContextData, void>
Registers a featured collection dispatcher.
- setFeaturedTagsDispatcher(): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: CollectionDispatcher<Hashtag, RequestContext<TContextData>, TContextData, void>
Registers a featured tags collection dispatcher.
- setFollowersDispatcher(): CollectionCallbackSetters<Context<TContextData>, TContextData, URL>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: CollectionDispatcher<Recipient, Context<TContextData>, TContextData, URL>
Registers a followers collection dispatcher.
- setFollowingDispatcher(): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: CollectionDispatcher<>Actor | URL,RequestContext<TContextData>,TContextData,void
Registers a following collection dispatcher.
- setHashlinkMediaDispatcher(dispatcher: HashlinkMediaDispatcher<TContextData>): void
Registers a dispatcher that serves resources addressed by hashlinks, such as media attached to portable objects, through the FEP-ef61 gateway endpoint, e.g.,
GET /.well-known/apgateway/hl:zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n. - setInboxDispatcher(): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>
Registers an inbox dispatcher.
- setInboxListeners(): InboxListenerSetters<TContextData>inboxPath: `${string}${Rfc6570Expression<"identifier">}${string}`,sharedInboxPath?: string
Assigns the URL path for the inbox and starts setting inbox listeners.
- setLikedDispatcher(): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: CollectionDispatcher<>Object | URL,RequestContext<TContextData>,TContextData,void
Registers a liked collection dispatcher.
- setMediaUploader(): MediaUploaderSetters<TContextData>path: `${string}${Rfc6570Expression<"identifier">}${string}`,callback: MediaUploaderCallback<TContextData>
Registers a media upload endpoint for the ActivityPub Media Upload extension. Clients
POSTamultipart/form-datarequest with afilepart (the binary payload) and anobjectpart (an ActivityStreams object shell) to this endpoint. The actor should advertise this endpoint underendpoints.uploadMediausing Context.getMediaUploaderUri. - setNodeInfoDispatcher(): voidpath: string,dispatcher: NodeInfoDispatcher<TContextData>
Registers a NodeInfo dispatcher.
- setObjectDispatcher<TObject extends Object, TParam extends string>(): ObjectCallbackSetters<TContextData, TObject, TParam>cls: ConstructorWithTypeId<TObject>,path: `${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}{${TParam}}${string}`,dispatcher: ObjectDispatcher<TContextData, TObject, TParam>
Registers an object dispatcher.
- setOrderedCollectionDispatcher<TObject extends Object, TParam extends string>(): CustomCollectionCallbackSetters<TParam, RequestContext<TContextData>, TContextData>name: string | symbol,itemType: ConstructorWithTypeId<TObject>,path: `${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}${Rfc6570Expression<TParam>}${string}`,dispatcher: CustomCollectionDispatcher<>TObject,TParam,RequestContext<TContextData>,TContextData
Registers an ordered collection of objects dispatcher.
- setOutboxDispatcher(): CollectionCallbackSetters<RequestContext<TContextData>, TContextData, void>path: `${string}${Rfc6570Expression<"identifier">}${string}`,dispatcher: CollectionDispatcher<Activity, RequestContext<TContextData>, TContextData, void>
Registers an outbox dispatcher.
- setOutboxListeners(outboxPath: `${string}${Rfc6570Expression<"identifier">}${string}`): OutboxListenerSetters<TContextData>
Assigns the URL path for the outbox and starts setting outbox listeners.
- setOutboxPermanentFailureHandler(handler: OutboxPermanentFailureHandler<TContextData>): void
Registers a handler for permanent delivery failures.
- setWebFingerLinksDispatcher(dispatcher: WebFingerLinksDispatcher<TContextData>): void
Registers a links dispatcher to WebFinger
An object that registers federation-related business logic and dispatches requests to the appropriate handlers.
- createContext(): Context<TContextData>baseUrl: URL,contextData: TContextData
Create a new context.
- fetch(): Promise<Response>request: Request,options: FederationFetchOptions<TContextData>
Handles a request related to federation. If a request is not related to federation, the
onNotFoundoronNotAcceptablecallback is called. - processQueuedTask(): Promise<void>contextData: TContextData,message: Message
Processes a queued message task. This method handles different types of tasks such as fanout, outbox, and inbox messages.
- startQueue(): Promise<void>contextData: TContextData,options?: FederationStartQueueOptions
Manually start the task queue.
Options for cooperative benchmark mode.
- allowUnsafeTriggerRecipients: boolean
Whether the benchmark trigger endpoint may deliver to recipients outside FederationBenchmarkOptions.triggerSinks.
- triggerSinks: readonly (string | URL)[]
Server-controlled inbox URLs that the benchmark trigger endpoint may deliver to.
A builder for creating a Federation object. It defers the actual instantiation of the Federation object until the build method is called so that dispatchers and listeners can be registered before the Federation object is instantiated.
- build(options: FederationOptions<TContextData>): Promise<Federation<TContextData>>
Builds the federation object.
Parameters of Federation.fetch method.
- contextData: TContextData
The context data to pass to the Context.
- onNotAcceptable: (request: Request) => Response | Promise<Response>
A callback to handle a request when the request's
Acceptheader is not acceptable. If not provided, a 406 response is returned. - onNotFound: (request: Request) => Response | Promise<Response>
A callback to handle a request when the route is not found. If not provided, a 404 response is returned.
- onUnauthorized: (request: Request) => Response | Promise<Response>
A callback to handle a request when the request is unauthorized. If not provided, a 401 response is returned.
Prefixes for namespacing keys in the Deno KV store.
- acceptSignatureNonce: KvKey
The key prefix used for storing
Accept-Signaturechallenge nonces. Only used when InboxChallengePolicy.requestNonce istrue. - activityIdempotence: KvKey
The key prefix used for storing whether activities have already been processed or not.
- circuitBreaker: KvKey
The key prefix used for storing outbound delivery circuit breaker state.
- httpMessageSignaturesSpec: KvKey
The key prefix used for caching HTTP Message Signatures specs. The cached spec is used to reduce the number of requests to make signed requests ("double-knocking" technique).
- portableInboxForwarding: KvKey
The key prefix used for remembering which activities received in FEP-ef61 portable inboxes have been forwarded to which gateways, so that each activity is forwarded at most once.
- publicKey: KvKey
The key prefix used for caching public keys.
- remoteDocument: KvKey
The key prefix used for storing remote JSON-LD documents.
- taskDeduplication: KvKey
The key prefix used for storing custom background task deduplication markers. Kept separate from activityIdempotence so the two key spaces never collide.
Options for creating a Federation object.
- activityTransformers: readonly ActivityTransformer<TContextData>[]
Activity transformers that are applied to outgoing activities. It is useful for adjusting outgoing activities to satisfy some ActivityPub implementations.
- allowPrivateAddress: boolean
Whether to allow private network addresses in the document loader and outbound activity delivery, including redirects.
- authenticatedDocumentLoaderFactory: AuthenticatedDocumentLoaderFactory
A factory function that creates an authenticated document loader for a given identity. This is used for fetching documents that require authentication.
- benchmarkMode: boolean | FederationBenchmarkOptions
Whether to enable cooperative benchmark mode. This mode exposes benchmark-only endpoints and relaxes selected defaults for benchmark targets. Pass an object to configure benchmark trigger delivery. Do not enable this option in production.
- circuitBreaker: false | CircuitBreakerOptions
The circuit breaker for queued outbound activity delivery. When enabled, Fedify tracks repeated failures per remote host and temporarily holds queued activities instead of repeatedly hammering an unreachable server.
- contextLoaderFactory: DocumentLoaderFactory
A custom JSON-LD context loader factory. By default, this uses the same loader as the document loader.
- 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).
- documentLoaderTimeout: Temporal.Duration | Temporal.DurationLike | null
The timeout for each call of the built-in document loader, context loader, and authenticated document loader, e.g., when Fedify fetches a key to verify a signature. The timeout is shared by all the steps of a call, including every redirect it follows, retries, and reading the response body. It does not cover the time spent reading from or writing to the cache.
- firstKnock: HttpMessageSignaturesSpec
The HTTP Signatures specification to use for the first signature attempt when communicating with unknown servers. This option affects the "double-knocking" mechanism as described in the ActivityPub HTTP Signature documentation.
- httpMessageSignaturesSpecTtl: Temporal.DurationLike
The time-to-live for a remote origin's remembered HTTP Message Signatures spec cached under FederationKvPrefixes.httpMessageSignaturesSpec. Once it expires, the next delivery to that origin relearns the spec by double-knocking and remembers it again.
- inboxChallengePolicy: InboxChallengePolicy
The policy for emitting
Accept-Signaturechallenges on inbox401responses (RFC 9421 §5). When enabled, failed HTTP Signature verification responses will include anAccept-Signatureheader telling the sender which components and parameters to include. - inboxRetryPolicy: RetryPolicy
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.
- kv: KvStore
The key–value store used for caching, outbox queues, and inbox idempotence.
- kvPrefixes: Partial<FederationKvPrefixes>
Prefixes for namespacing keys in the Deno KV store. By default, all keys are prefixed with
["_fedify"]. - manuallyStartQueue: boolean
Whether to start the task queue manually or automatically.
- maxHttpSignatures: number
The maximum number of RFC 9421 signatures of an incoming request to verify, e.g., in the inbox and in RequestContext.getSignedKey. A request can carry several signatures, each of which may make Fedify fetch the key that it names, so only the first ones in the order of the
Signature-Inputheader are verified, and the rest are ignored as if they were absent. Every signature among the first ones counts, even if it fails before its key is fetched. See also themaxSignaturesoption ofverifyRequest(). - meterProvider: MeterProvider
The OpenTelemetry meter provider for recording metrics. If not provided, the default global meter provider is used.
- onOutboxError: OutboxErrorHandler
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.
- origin: string | FederationOrigin
The canonical base URL of the server. This is used for constructing absolute URLs and fediverse handles.
- outboxRetryPolicy: RetryPolicy
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.
- permanentFailureStatusCodes: readonly number[]
HTTP status codes that should be treated as permanent delivery failures. When an inbox returns one of these codes, the delivery will not be retried and the permanent failure handler (if registered via Federatable.setOutboxPermanentFailureHandler) will be called.
- portableInboxForwarding: PortableInboxForwardingOptions
Options for forwarding activities received in FEP-ef61 portable inboxes to the other gateways of their actors.
- publicKeyTtl: Temporal.DurationLike
The time-to-live for a remote actor's public key cached under FederationKvPrefixes.publicKey. Once it expires, the next signature verification that needs the key refetches it from the remote server and caches it again.
- queue: FederationQueueOptions | MessageQueue
The message queue for sending and receiving activities. If not provided, activities will not be queued and will be processed immediately.
- signatureTimeWindow: Temporal.Duration | Temporal.DurationLike | false
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. - skipSignatureVerification: boolean
Whether to skip HTTP Signatures verification for incoming activities. This is useful for testing purposes, but should not be used in production.
- taskDeduplicationFallback: "open" | "closed"
The behavior when a TaskEnqueueOptions.deduplicationKey is supplied but the task's queue does not declare MessageQueue.nativeDeduplication and the configured KvStore exposes no
cas(compare-and-swap) primitive: - taskDeduplicationTtl: Temporal.DurationLike
The time-to-live for a TaskEnqueueOptions.deduplicationKey marker stored in the key–value deduplication fallback. A second enqueue with the same key within this window is skipped; once it expires, the key may enqueue again. Ignored when the task's queue declares MessageQueue.nativeDeduplication (the backend owns the window).
- taskQueueResolution: "fallback" | "strict"
How a queue is resolved for a custom background task when neither a per-task queue (TaskDefinitionOptions.queue) nor a dedicated task queue (FederationQueueOptions.task) is configured.
- taskRetryPolicy: RetryPolicy
The retry policy for processing custom background tasks. By default, this uses an exponential backoff strategy with a maximum of 10 attempts and a maximum delay of 12 hours. A per-task retry policy (TaskDefinitionOptions.retryPolicy) overrides this.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider for tracing operations. If not provided, the default global tracer provider is used.
- trailingSlashInsensitive: boolean
Whether the router should be insensitive to trailing slashes in the URL paths. For example, if this option is
true,/fooand/foo/are treated as the same path. Turned off by default. - userAgent: GetUserAgentOptions | string
Options for making
User-Agentstrings for HTTP requests. If a string is provided, it is used as theUser-Agentheader. If an object is provided, it is passed to the getUserAgent function.
Options for FederationOptions.origin when it is not a string.
- handleHost: string
The canonical hostname for fediverse handles (which are looked up through WebFinger). This is used for WebFinger lookups. It has to be a valid hostname, e.g.,
"example.com". - webOrigin: string
The canonical origin for web URLs. This is used for constructing absolute URLs. It has to start with either
"http://"or"https://", and must not contain a path or query string, e.g.,"https://example.com".
Configures the task queues for sending and receiving activities.
- fanout: MessageQueue
The message queue for fanning out outgoing activities. If not provided, outgoing activities will not be fanned out in the background, but will be fanned out immediately, which causes slow response times on Context.sendActivity calls.
- inbox: MessageQueue
The message queue for incoming activities. If not provided, incoming activities will not be queued and will be processed immediately.
- outbox: MessageQueue
The message queue for outgoing activities. If not provided, outgoing activities will not be queued and will be sent immediately.
- task: MessageQueue
The message queue for custom background tasks. If not provided, tasks are routed to the outbox queue (unless FederationOptions.taskQueueResolution is
"strict").
Options for Federation.startQueue method.
The result of fetchKeyDetailed.
- fetchError: FetchKeyErrorResult
The error that occurred while fetching the key, if fetching failed before a document could be parsed.
Options for fetchKey.
- contextLoader: DocumentLoader
The context loader for loading remote JSON-LD contexts.
- documentLoader: DocumentLoader
The document loader for loading remote JSON-LD documents.
- keyCache: KeyCache
The key cache to use for caching public keys.
- keyIdBoundByCaller: boolean
An assertion by the caller that it has already bound this key's id to whoever the key will be treated as speaking for, by means of its own that key resolution cannot see.
- meterProvider: MeterProvider
The OpenTelemetry meter provider to use for recording
activitypub.key.lookupandactivitypub.key.lookup.duration. If omitted, the global meter provider is used. - portableKeyResolvers: PortableKeyResolvers
Resolves keys of FEP-ef61 portable actors, which only HTTP Signature verification passes, so that only it accepts them. Object Integrity Proofs and Linked Data Signatures never do: such a key is rejected if this is omitted.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider to use for tracing. If omitted, the global tracer provider is used.
The result of fetchKey.
The result of fulfillAcceptSignature. This can be used directly
as the rfc9421 option of SignRequestOptions.
- components: AcceptSignatureComponent[]
The merged set of covered component identifiers, including all component parameters, ready to be passed to the signer.
- expires: true
If
true, the challenger requested that the signer generate and include an expiration timestamp in the signature parameters. - label: string
The label for the signature.
- nonce: string
The nonce requested by the challenge, if any.
- tag: string
The tag requested by the challenge, if any.
Options for RequestContext.getActor.
- tombstone: "suppress" | "passthrough"
Controls how tombstoned actors are returned.
Options for getKeyOwner.
- contextLoader: DocumentLoader
The context loader to use for JSON-LD context retrieval.
- documentLoader: DocumentLoader
The document loader to use for fetching the key and its owner.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider to use for tracing. If omitted, the global tracer provider is used.
Options for getNodeInfo function.
- direct: boolean
Whether to directly fetch the NodeInfo document from the given URL. Otherwise, the NodeInfo document will be fetched from the
.well-knownlocation of the given URL. - parse: "strict" | "best-effort" | "none"
How strictly to parse the NodeInfo document.
- userAgent: GetUserAgentOptions | string
The options for making
User-Agentheader. If a string is given, it is used as theUser-Agentheader value. If an object is given, it is passed to getUserAgent to generate theUser-Agentheader value.
Options for RequestContext.getObject.
- tombstone: "suppress" | "passthrough"
Controls how tombstoned objects are returned.
Options for Context.getSignedKey method.
- contextLoader: DocumentLoader
The context loader for loading remote JSON-LD contexts.
- documentLoader: DocumentLoader
The document loader for loading remote JSON-LD documents.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider. If omitted, the global tracer provider is used.
A request for a resource addressed by a hashlink, which an
FEP-ef61 gateway serves at
/.well-known/apgateway/hl:<digestMultibase>.
- algorithm: "sha2-256"
The hash algorithm of the digest.
- digest: Uint8Array
The raw 32-byte SHA-256 digest of the resource.
- digestMultibase: string
The multibase-encoded multihash as requested, which is the value that publishers put in the
digestMultibaseproperty. The same digest can be encoded in several multibase encodings; use HashlinkMediaRequest.digest as a storage key to find a resource regardless of the encoding. - hashlink: `hl:${string}`
The requested hashlink, i.e.,
hl:followed by HashlinkMediaRequest.digestMultibase, after percent-decoding and with its scheme lowercased. - multihash: Uint8Array
The multihash decoded from HashlinkMediaRequest.digestMultibase, i.e., the hash algorithm code and the digest length followed by the digest.
A spec determiner for HTTP Message Signatures. It determines the spec to use for signing requests. It is used for double-knocking (see https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions).
- determineSpec(origin: string):HttpMessageSignaturesSpec
| Promise<HttpMessageSignaturesSpec>Determines the spec to use for signing requests.
- rememberSpec(): void | Promise<void>origin: string,spec: HttpMessageSignaturesSpec
Remembers the successfully used spec for the given origin.
Policy for emitting Accept-Signature challenges on inbox 401
responses, as defined in
RFC 9421 §5.
- components: string[]
The covered component identifiers to request. Only request-applicable identifiers should be used (
@statusis automatically excluded). - enabled: boolean
Whether to emit
Accept-Signatureheaders on401responses caused by HTTP Signature verification failures. - nonceTtlSeconds: number
The time-to-live (in seconds) for stored nonces. After this period, nonces expire and are no longer accepted.
- requestNonce: boolean
Whether to generate and require a one-time nonce for replay protection. When enabled, a cryptographically random nonce is included in each challenge and verified on subsequent requests. Requires a KvStore.
A context for inbox listeners.
- clone(data: TContextData): InboxContext<TContextData>
Creates a new context with the same properties as this one, but with the given data.
- forwardActivity(): Promise<void>forwarder:SenderKeyPair
| SenderKeyPair[]
| { identifier: string; }
| { username: string; },recipients: Recipient | Recipient[],options?: ForwardActivityOptionsForwards a received activity to the recipients' inboxes. The forwarded activity will be signed in HTTP Signatures by the forwarder, but its payload will not be modified, i.e., Linked Data Signatures and Object Integrity Proofs will not be added. Even when Fedify internally normalizes a Linked Data Signature activity for parsing, this method still forwards the original received payload so the sender's signatures/proofs are preserved as-is. Therefore, if the activity is not signed (i.e., it has neither Linked Data Signatures nor Object Integrity Proofs), the recipient probably will not trust the activity.
- recipient: string | null
The identifier of the recipient of the inbox. If the inbox is a shared inbox, it is
null.
Registry for inbox listeners for different activity types.
- on<TActivity extends Activity>(): InboxListenerSetters<TContextData>type: new (...args: any[]) => TActivity,listener: InboxListener<TContextData, TActivity>
Registers a listener for a specific incoming activity type.
- onError(handler: InboxErrorHandler<TContextData>): InboxListenerSetters<TContextData>
Registers an error handler for inbox listeners. Any exceptions thrown from the listeners are caught and passed to this handler.
- onRequestFinished(handler: InboxRequestFinishedHandler<TContextData>): InboxListenerSetters<TContextData>
Observes each configured inbox delivery once, before fetch finishes. The callback is awaited and its errors do not alter delivery processing. Calling this again replaces the previous callback. Built federations retain the callback registered at build time.
- onUnverifiedActivity(handler: UnverifiedActivityHandler<TContextData>): InboxListenerSetters<TContextData>
Registers a callback for incoming activities whose HTTP signatures could not be verified.
- setSharedKeyDispatcher(dispatcher: SharedInboxKeyDispatcher<TContextData>): InboxListenerSetters<TContextData>
Configures a callback to dispatch the key pair for the authenticated document loader of the Context passed to the shared inbox listener.
- withIdempotency(strategy: IdempotencyStrategy | IdempotencyKeyCallback<TContextData>): InboxListenerSetters<TContextData>
Configures the strategy for handling activity idempotency in inbox processing.
Observations of a single inbox delivery request.
- activity: Activity | null
The Activity obtained by the normal processing flow, if any.
- attempts: readonly InboxVerificationAttempt[]
Logical evaluations, including unsuccessful fallback paths.
- authentication: InboxAuthentication
Cryptographic success alone does not imply this decision is verified.
- inbox: { readonly kind: "personal" | "shared" | "portable"; readonly recipient: string | null; }
The delivery route, including a portable gateway route.
- outcome: InboxRequestOutcome
Response status snapshot or the original exception.
- payload:{ readonly status: "unavailable"; }
| { readonly status: "parsed"; readonly value: InboxJsonValue; }Unavailable differs from a successfully parsed JSON null.
Additional options for InProcessMessageQueue.
- pollInterval: Temporal.Duration | Temporal.DurationLike
The interval to poll for messages in the queue. 5 seconds by default.
Options for RequestContext.isSignedByAudience method.
- isMember: () => boolean | Promise<boolean>addressee: URL,actor: Actor
Checks whether the actor who signed the request is a member of an addressee of the object that is not the actor itself, e.g., a followers collection. Fedify does not resolve collections by itself, as only the application can tell their members reliably.
A cache for storing cryptographic keys.
An abstract interface for a key–value store.
- cas: () => Promise<boolean>key: KvKey,expectedValue: unknown,newValue: unknown,options?: KvStoreSetOptions
Compare-and-swap (CAS) operation for the key–value store.
- delete(key: KvKey): Promise<void>
Deletes the value for the given key.
- get<T = unknown>(key: KvKey): Promise<T | undefined>
Gets the value for the given key.
- list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>
Lists all entries in the store that match the given prefix. If no prefix is given, all entries are returned.
- set(): Promise<void>key: KvKey,value: unknown,options?: KvStoreSetOptions
Sets the value for the given key.
An entry returned by the KvStore.list method.
Additional options for setting a value in a key–value store.
- ttl: Temporal.Duration
The time-to-live (TTL) for the value.
An object to configure the media upload endpoint registered through Federatable.setMediaUploader.
- authorize(predicate: AuthorizePredicate<TContextData>): MediaUploaderSetters<TContextData>
Registers a callback to authorize requests to the media upload endpoint.
An abstract interface for a message queue.
- atomicEnqueueMany: boolean
Whether enqueueMany accepts either every message or no messages. Backends that implement
enqueueMany()by sending messages individually must set this tofalse, so Fedify does not use that method for a batch governed by onededuplicationKey.trueby default whenenqueueManyis implemented. - enqueue(): Promise<void>message: any,options?: MessageQueueEnqueueOptions
Enqueues a message in the queue.
- enqueueMany: () => Promise<void>messages: readonly any[],options?: MessageQueueEnqueueOptions
Enqueues multiple messages in the queue. This operation is optional, and may not be supported by all implementations. If not supported, Fedify will invoke enqueue for each message. An implementation that may accept only part of a batch before rejecting must declare atomicEnqueueMany
false. - getDepth(): Promise<MessageQueueDepth>
Gets the number of messages waiting in the queue.
- listen(): Promise<void>handler: (message: any) => Promise<void> | void,options?: MessageQueueListenOptions
Listens for messages in the queue.
- nativeDeduplication: boolean
Whether the message queue backend deduplicates messages that share a MessageQueueEnqueueOptions.deduplicationKey natively. When
true, Fedify forwards thededuplicationKeyand relies on the backend to drop duplicates; whenfalseor omitted, Fedify applies its own best-effort key–value deduplication on the paths that request it. - nativeRetrial: boolean
Whether the message queue backend provides native retry mechanisms. When
true, Fedify will skip its own retry logic and rely on the backend to handle retries. Whenfalseor omitted, Fedify will handle retries using its own retry policies.
The number of messages waiting in a message queue.
Additional options for enqueuing a message in a queue.
- deduplicationKey: string
An optional key requesting at-most-once enqueue semantics for messages that share it. A backend that declares MessageQueue.nativeDeduplication
trueowns the check: a message whosededuplicationKeywas already seen within the backend's deduplication window is dropped instead of enqueued. Backends without native deduplication ignore this field; Fedify performs its own best-effort deduplication before reaching them on the paths that support it. - delay: Temporal.Duration
The delay before the message is enqueued. No delay by default.
- orderingKey: string
An optional key that ensures messages with the same ordering key are processed sequentially (one at a time). Messages with different ordering keys (or no ordering key) may be processed in parallel.
Additional options for listening to a message queue.
- signal: AbortSignal
The signal to abort listening to the message queue.
A NodeInfo object as defined in the NodeInfo 2.1 schema.
- metadata: Readonly<Record<string, JsonValue>>
Free form key value pairs for software specific values. Clients should not rely on any specific key present.
- openRegistrations: boolean
Whether this server allows open self-registration. Defaults to
false. - protocols: readonly Protocol[]
The protocols supported on this server. At least one protocol must be supported.
- services: Services
The third party sites this server can connect to via their application API.
- software: Software
Metadata about server software in use.
- usage: Usage
Usage statistics for this server.
Additional settings for an object dispatcher.
- authorize(predicate: ObjectAuthorizePredicate<TContextData, TParam>): ObjectCallbackSetters<TContextData, TObject, TParam>
Specifies the conditions under which requests are authorized.
A context for outbox listeners.
- clone(data: TContextData): OutboxContext<TContextData>
Creates a new context with the same properties as this one, but with the given data.
- forwardActivity(): Promise<void>forwarder:SenderKeyPair
| SenderKeyPair[]
| { identifier: string; }
| { username: string; },recipients: Recipient | Recipient[],options?: ForwardActivityOptionsForwards a posted activity to the recipients' inboxes without re-serializing the original payload. The forwarded activity will be signed in HTTP Signatures by the forwarder, but its payload will not be modified, i.e., Linked Data Signatures and Object Integrity Proofs will not be added. Therefore, if the posted activity is not signed (i.e., it has neither Linked Data Signatures nor Object Integrity Proofs), the recipients probably will not trust the activity.
- hasDeliveredActivity(): boolean
Indicates whether the posted activity has been delivered during the current outbox listener invocation.
- identifier: string
The identifier of the actor whose outbox received the POST.
Registry for outbox listeners for different activity types.
- authorize(predicate: AuthorizePredicate<TContextData>): OutboxListenerSetters<TContextData>
Registers a callback to authorize POST requests to the outbox.
- on<TActivity extends Activity>(): OutboxListenerSetters<TContextData>type: new (...args: any[]) => TActivity,listener: OutboxListener<TContextData, TActivity>
Registers a listener for a specific incoming activity type.
- onError(handler: OutboxListenerErrorHandler<TContextData>): OutboxListenerSetters<TContextData>
Registers an error handler for outbox listeners. Any exceptions thrown from the listeners are caught and passed to this handler.
A page of items.
- items: readonly TItem[]No documentation available
- nextCursor: string | nullNo documentation available
- prevCursor: string | nullNo documentation available
Options for parseNodeInfo function.
- tryBestEffort: boolean
Whether to try to parse the NodeInfo document even if it is invalid. If turned on, the function will return a best-effort result.
Options for Context.parseUri.
- portable: boolean
Whether to also recognize FEP-ef61 portable IDs, i.e.,
ap:andap+ef61:URIs, and their compatible identifiers on any gateway. The result of a portable ID has its DID, without percent-encoding, in theauthorityproperty, which the caller has to compare with the DID that it stores for the actor or object, since anyone can make a portable ID with the same path under another DID.
Options for forwarding activities received in FEP-ef61 portable inboxes to the other gateways of their actors. See FederationOptions.portableInboxForwarding.
- deadline: Temporal.DurationLike
How long a delivery waits for forwarding requests made immediately, i.e., when no outbox queue is configured, before Fedify responds to it. Requests still running afterwards continue in the background. It also bounds verifying the HTTP Signature that identifies the gateway which forwarded the delivery, with or without an outbox queue; if the verification does not finish in time, the activity is forwarded to that gateway as well. It cannot have calendar units, i.e., weeks, months, or years, and cannot be longer than 2,147,483,647 milliseconds (about 24.8 days), the longest delay timers support.
- maxTargets: number
The maximum number of other gateways that a single delivery is forwarded to. Gateways beyond it are skipped with a warning.
0turns off forwarding. - ttl: Temporal.DurationLike
How long Fedify remembers that it has forwarded an activity from a portable inbox to a gateway, under FederationKvPrefixes.portableInboxForwarding. Within it, the same activity is never forwarded to the same gateway again; once it expires, a redelivery of the activity may be forwarded again. It cannot have calendar units, i.e., weeks, months, or years.
Information about an FEP-ef61 portable object requested through the gateway endpoint. See RequestContext.portableRequest.
- authority: string
The DID authority of the requested portable object, e.g.,
did:key:z6Mk.... It comes from the request path, so it is not evidence that this server hosts objects for the DID. - id: URL
The ID of the requested portable object or collection, e.g.,
ap+ef61://did:key:z6Mk.../notes/123, without a query. Like other portable IDs, theURLkeeps the DID authority percent-encoded; useformatIri()from@fedify/vocab-runtimeto get the canonical string. Each access returns a newURLinstance.
A context for a request.
- clone(data: TContextData): RequestContext<TContextData>
Creates a new context with the same properties as this one, but with the given data.
- getActor(identifier: string): Promise<Actor | null>
Gets an Actor object for the given identifier.
- getObject<TObject extends Object>(): Promise<TObject | null>cls: ConstructorWithTypeId<TObject>,values: Record<string, string>
Gets an object of the given class with the given values.
- getPortableActorUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor with the given identifier. It works the same as Context.getPortableActorUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableCollectionUri<TParam extends Record<string, string>>(): URLname: string | symbol,values: TParam,authority?: string
Builds the FEP-ef61 portable ID of a custom collection with the given name and values. It works the same as Context.getPortableCollectionUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableFeaturedTagsUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor's featured tags collection with the given identifier. It works the same as Context.getPortableFeaturedTagsUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableFeaturedUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor's featured collection with the given identifier. It works the same as Context.getPortableFeaturedUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableFollowersUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor's followers collection with the given identifier. It works the same as Context.getPortableFollowersUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableFollowingUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor's following collection with the given identifier. It works the same as Context.getPortableFollowingUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableInboxUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor's inbox with the given identifier. It works the same as Context.getPortableInboxUri, except that the authority can be omitted while handling a portable object request, i.e., when RequestContext.portableRequest is set. In that case, its DID is used. Deliveries to portable inboxes do not set RequestContext.portableRequest, so pass the authority explicitly while handling them.
- getPortableLikedUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor's liked collection with the given identifier. It works the same as Context.getPortableLikedUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableObjectUri<TObject extends Object>(): URLcls: ConstructorWithTypeId<TObject>,values: Record<string, string>,authority?: string
Builds the FEP-ef61 portable ID of an object with the given class and values. It works the same as Context.getPortableObjectUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getPortableOutboxUri(): URLidentifier: string,authority?: string
Builds the FEP-ef61 portable ID of an actor's outbox with the given identifier. It works the same as Context.getPortableOutboxUri, except that the authority can be omitted while handling a portable gateway request. In that case, the DID in RequestContext.portableRequest is used.
- getSignedKey(): Promise<CryptographicKey | null>
Gets the public key of the sender, if any exists and it is verified. Otherwise,
nullis returned. - getSignedKeyOwner(): Promise<Actor | null>
Gets the owner of the signed key, if any exists and it is verified. Otherwise,
nullis returned. - isSignedByAudience(): Promise<boolean>object: Object,options?: IsSignedByAudienceOptions
Checks whether the request is signed by an actor who belongs to the intended audience of an object, i.e., the owner of the signed key (see RequestContext.getSignedKeyOwner) is one of the object's
to,cc,bto,bcc, andaudience, or a member of one of them according to theisMemberoption. - portableRequest: PortableRequest
Information about the FEP-ef61 portable object requested through the gateway endpoint, e.g.,
GET /.well-known/apgateway/did:key:z6Mk.../notes/123, which is served by an object dispatcher, the actor dispatcher, or a collection dispatcher. It isundefinedfor ordinary requests. - request: Request
The request object.
- url: URL
The URL of the request.
Options for the respondWithObject and respondWithObjectIfAcceptable functions.
- contextLoader: DocumentLoader
The document loader to use for compacting JSON-LD.
The context passed to a RetryPolicy callback.
- attempts: number
The number of attempts so far.
- elapsedTime: Temporal.Duration
The elapsed time since the first attempt.
Options for customizing the RFC 9421 signature label, covered components,
and metadata parameters. These are typically derived from an
Accept-Signature challenge.
- components: AcceptSignatureComponent[]
The covered component identifiers. When omitted, the default set
["@method", "@target-uri", "@authority", "host", "date"](plus"content-digest"when a body is present) is used. - expires: true
If
true, an expiration timestamp is generated and included in the signature parameters. The expiration time defaults to one hour after the signature creation time. - label: string
The label for the signature in
Signature-InputandSignatureheaders. - nonce: string
A nonce value to include in the signature parameters.
- tag: string
A tag value to include in the signature parameters.
Options for Context.routeActivity method.
- contextLoader: DocumentLoader
The context loader for loading remote JSON-LD contexts.
- documentLoader: DocumentLoader
The document loader for loading remote JSON-LD documents.
- immediate: boolean
Whether to skip enqueuing the activity and invoke the listener immediately. If no inbox queue is available, this option is ignored and the activity will be always invoked immediately.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider. If omitted, the global tracer provider is used.
Options for Context.sendActivity method.
- excludeBaseUris: readonly URL[]
The base URIs to exclude from the recipients' inboxes. It is useful for excluding the recipients having the same shared inbox with the sender.
- fanout: "auto" | "skip" | "force"
Determines how activities are queued when sent to multiple recipients.
- immediate: boolean
Whether to send the activity immediately, without enqueuing it. If
true, the activity will be sent immediately and the retrial policy will not be applied. - normalizeExistingProofs: boolean
Whether to apply Fedify's outgoing JSON-LD wire-format compatibility fixes to activities that already carry Object Integrity Proofs.
- orderingKey: string
An optional key to ensure ordered delivery of activities. Activities with the same
orderingKeyare guaranteed to be delivered in the order they were enqueued, per recipient server. - preferSharedInbox: boolean
Whether to prefer the shared inbox for the recipients.
Options for Context.sendActivity method when sending to a collection.
- syncCollection: boolean
Whether to synchronize the collection using
Collection-Synchronizationheader (FEP-8fcf).
A key pair for an actor who sends an activity.
- keyId: URL
The public key ID that corresponds to the private key.
- privateKey: CryptoKey
The actor's private key to sign the request.
The third party sites this server can connect to via their application API.
Options for signing JSON-LD documents.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider for tracing the signing process. If omitted, the global tracer provider is used.
Options for signObject.
- documentLoader: DocumentLoader
The document loader for loading remote JSON-LD documents.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider. If omitted, the global tracer provider is used.
Options for signRequest.
- body: ArrayBuffer | null
The request body as ArrayBuffer. If provided, avoids cloning the request body.
- currentTime: Temporal.Instant
The current time. If not specified, the current time is used. This is useful for testing.
- rfc9421: Rfc9421SignRequestOptions
Options specific to the RFC 9421 signing path. These options are ignored when
specis"draft-cavage-http-signatures-12". - spec: HttpMessageSignaturesSpec
The HTTP message signatures specification to use for signing.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider. If omitted, the global tracer provider is used.
Metadata about server software in use.
- homepage: URL
The URL of the homepage of this server software.
- name: string
The canonical name of this server software. This must comply with pattern
/^[a-z0-9-]+$/. - repository: URL
The URL of the source code repository of this server software.
- version: string
The version of this server software.
The handle returned by TaskRegistry.defineTask. It carries the task name and schema so that Context.enqueueTask can validate the payload and infer its type at every call site.
- contextDataBrand: TContextDataNo documentation available
- name: string
The unique name of the task.
- schema: StandardSchemaV1<unknown, TData>
The Standard Schema that validates the task payload.
Options for TaskRegistry.defineTask.
- handler: TaskHandler<TContextData, StandardSchemaV1.InferOutput<TSchema>>
The callback that processes the task on a background worker.
- onError: () => Promise<void> | voidctx: Context<TContextData>,error: unknown,data: StandardSchemaV1.InferOutput<TSchema>
A callback invoked when the handler throws an error, before a retry is scheduled.
- queue: MessageQueue
The message queue dedicated to this task. If omitted, the task is routed to the federation-wide task queue, falling back to the outbox queue (unless
taskQueueResolution: "strict"is configured). - retryPolicy: RetryPolicy
The retry policy for this task. If omitted, the federation-wide task retry policy is used, which defaults to an exponential backoff policy.
- schema: TSchema
The Standard Schema that validates the task payload. The payload type is inferred from this schema.
Options for Context.enqueueTask and Context.enqueueTaskMany.
- deduplicationKey: string
An optional key requesting at-most-once enqueue for tasks that share it.
- delay: Temporal.DurationLike
The delay before the task is processed. No delay by default.
- orderingKey: string
An optional key that ensures tasks with the same ordering key are processed sequentially (one at a time).
Registration of custom background tasks. Both Federation and FederationBuilder implement this interface.
- defineTask<TSchema extends StandardSchemaV1>(): TaskDefinition<TContextData, StandardSchemaV1.InferOutput<TSchema>>name: string,options: TaskDefinitionOptions<TContextData, TSchema>
Defines a custom background task. The returned handle is passed to Context.enqueueTask to enqueue the task.
Usage statistics for this server.
- localComments: number
The amount of comments that were made by users that are registered on this server. This number has to be an integer greater than or equal to zero.
- localPosts: number
The amount of posts that were made by users that are registered on this server. This number has to be an integer greater than or equal to zero.
- users: { readonly total?: number; readonly activeHalfyear?: number; readonly activeMonth?: number; }
Statistics about the users of this server.
Options for verifying JSON-LD documents.
Options for verifyObject.
- verifyPortableObject: PortableObjectVerifier
The default FEP-ef61 portable object verifier for the property accessors of the returned object and the objects obtained from it, e.g.,
Context.verifyPortableObject. It is not used to verify the given object itself.
Options for verifyPortableObject.
Options for verifyProof.
- challenge: string
The challenge expected by the verifier. When specified, it must exactly match the proof's
challengeoption. - contextLoader: DocumentLoader
The context loader for loading remote JSON-LD contexts.
- documentLoader: DocumentLoader
The document loader for loading remote JSON-LD documents.
- domain: string | readonly string[]
The security domain expected by the verifier. When specified, it must contain the same strings as the proof's
domainoption. - keyCache: KeyCache
The key cache to use for caching public keys.
- meterProvider: MeterProvider
The OpenTelemetry meter provider. If omitted, the global meter provider is used.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider. If omitted, the global tracer provider is used.
Options for verifyRequest.
- contextLoader: DocumentLoader
The context loader to use for JSON-LD context retrieval.
- currentTime: Temporal.Instant
The current time. If not specified, the current time is used. This is useful for testing.
- documentLoader: DocumentLoader
The document loader to use for fetching the public key.
- keyCache: KeyCache
The key cache to use for caching public keys.
- maxSignatures: number
The maximum number of RFC 9421 signatures of a request to verify. A request can carry several signatures, each of which may make Fedify fetch the key that it names, so only the first ones in the order of the
Signature-Inputheader are verified, and the rest are ignored as if they were absent. Every signature among the first ones counts, even if it fails before its key is fetched, e.g., because it is too old, or names the same key as another one. The key of a key ID is looked up only once for all the signatures that name it. - meterProvider: MeterProvider
The OpenTelemetry meter provider. If omitted, the global meter provider is used.
- spec: HttpMessageSignaturesSpec
The HTTP message signatures specification to use for verifying.
- timeWindow: Temporal.Duration | Temporal.DurationLike | false
The time window to allow for the request date. The actual time window is twice the value of this option, with the current time as the center. Or if it is
false, no time check is performed. - tracerProvider: TracerProvider
The OpenTelemetry tracer provider. If omitted, the global tracer provider is used.
Options for verifying Linked Data Signatures.
- contextLoader: DocumentLoader
The context loader to use for JSON-LD context retrieval.
- documentLoader: DocumentLoader
The document loader to use for fetching the public key.
- keyCache: KeyCache
The key cache to use for caching public keys.
- meterProvider: MeterProvider
The OpenTelemetry meter provider. If omitted, the global meter provider is used.
- tracerProvider: TracerProvider
The OpenTelemetry tracer provider for tracing the verification process. If omitted, the global tracer provider is used.
Parameters for handleWebFinger.
- actorAliasMapper: ActorAliasMapper<TContextData>
The callback for mapping a WebFinger query to the corresponding actor's internal identifier or username, or
nullif the query is not found. - actorDispatcher: ActorDispatcher<TContextData>
The callback for dispatching the actor.
- actorHandleMapper: ActorHandleMapper<TContextData>
The callback for mapping a WebFinger username to the corresponding actor's internal identifier, or
nullif the username is not found. - context: RequestContext<TContextData>
The request context.
- host: string
The canonical hostname of the server, if it's explicitly configured.
- meterProvider: MeterProvider
The OpenTelemetry meter provider used to record the
webfinger.handlecounter andwebfinger.handle.durationhistogram. When omitted, no WebFinger-specific measurements are emitted (the request still contributes tofedify.http.server.request.*because that metric is recorded one layer up inFederation.fetch). - onNotFound(request: Request): Response | Promise<Response>
The function to call when the actor is not found.
- span: Span
The span for the request.
- tracer: Tracer
The OpenTelemetry tracer.
- webFingerLinksDispatcher: WebFingerLinksDispatcher<TContextData>
The callback for dispatching the Links of webFinger.
Options for the Router.
The result of Router.route method.
Type Aliases
A function that transforms an activity object.
| { username: string; }
| null
| Promise<{ identifier: string; } | { username: string; } | null>
A callback that maps a WebFinger query to the corresponding actor's
internal identifier or username, or null if the query is not found.
A callback that dispatches an Actor object or a Tombstone.
A callback that maps a WebFinger username to the corresponding actor's
internal identifier, or null if the username is not found.
A callback that dispatches key pairs for an actor.
| { readonly failure?: never; readonly failureThreshold?: number; readonly failureWindow?: Temporal.Duration | Temporal.DurationLike; }
Configures how a remote host circuit opens after repeated delivery failures.
& { readonly recoveryDelay?: Temporal.Duration | Temporal.DurationLike; readonly heldActivityTtl?: Temporal.Duration | Temporal.DurationLike; readonly releaseInterval?: Temporal.Duration | Temporal.DurationLike; readonly stateTtl?: Temporal.Duration | Temporal.DurationLike; readonly onStateChange?: (
Options for Fedify's outbound activity circuit breaker.
The state of a remote host circuit breaker.
A callback that counts the number of items in a collection.
A callback that returns a cursor for a collection.
A callback that dispatches a collection.
Represents an object with a type ID, which is either a constructor or an instance of the object.
A callback that counts the number of items in a custom collection.
A callback that returns a cursor for a custom collection.
A callback that dispatches a custom collection.
| { readonly error: Error; }
Detailed fetch failure information from fetchKeyDetailed.
& { skipIfUnsigned: boolean; }
Options for InboxContext.forwardActivity method.
A callback that serves a resource addressed by a hashlink through the FEP-ef61 gateway endpoint.
The standard to use for signing and verifying HTTP signatures.
A callback to generate a custom idempotency key for an activity. Returns the cache key to use, or null to skip idempotency checking.
The strategy for handling activity idempotency in inbox processing.
| "gnusocial"
| "imap"
| "pnut"
| "pop3"
| "pumpio"
| "rss2.0"
| "twitter"
The third party sites this server can retrieve messages from for combined display with regular traffic.
| { readonly status: "rejected"; readonly reason:
| { readonly type: "actorKeyMismatch"; readonly key: InboxVerificationKey; readonly actorIds: readonly URL[]; }
| { readonly type: "proofPolicy"; readonly policy: "portableActor" | "portableActivity" | "compound"; readonly detail?: import("../sig/verification.ts").InboxProofPolicyFailureReason; }
| { readonly type: "invalidNonce"; }
| { readonly status: "skipped"; }
| { readonly status: "notDetermined"; }
The final inbox authentication decision.
A callback that handles errors in an inbox.
| boolean
| number
| string
| readonly InboxJsonValue[]
| { readonly [key: string]: InboxJsonValue; }
A JSON value retained from the incoming request.
A callback that listens for activities in an inbox.
| CompoundPortableObjectFailureReason
| CompoundProofDiscoveryFailureReason
| { readonly type: "invalidObjectId" | "invalidDocument" | "subjectMismatch"; }
A bounded proof-policy diagnostic.
Observes an inbox delivery after processing, before fetch resolves/rethrows. The callback is awaited. Its errors are logged and swallowed, preserving the original response/exception. The last registered callback replaces the previous one. It excludes inbox collection GETs, unmatched routes, programmatic routing, and queue workers. This is not an atomic persistence guarantee. Keys/owner/controller declarations remain untrusted unless the final authentication decision verifies them.
| "enqueued"
| "duplicate"
| "unhandled"
| "customResponse"
| { readonly type: "response"; readonly status: number; readonly disposition: "rejected"; readonly reason:
| "invalidJson"
| "invalidJsonLd"
| "invalidActivity"
| "bodyTooLarge"
| "missingActor"
| "authentication"
| { readonly type: "response"; readonly status: number; readonly disposition: "failed"; readonly reason: "bodyUnavailable" | "enqueueError" | "listenerError"; readonly error?: unknown; }
| { readonly type: "exception"; readonly stage:
| "parse"
| "verify"
| "policy"
| "dispatch"
| "respond"
How an inbox request finished.
& { readonly declaredKeyId: string | null; readonly triedKeys: readonly InboxVerificationKey[]; }
& (
| { readonly status: "rejected"; readonly reason: InboxSignatureFailureReason; }
| { readonly status: "error"; readonly error: unknown; }
Evidence from one signature/proof, including cached-key retries.
| { readonly type: "keyFetchError"; readonly keyId: URL; readonly result: FetchKeyErrorResult; }
Why a cryptographic check failed.
| { readonly mechanism: "linkedData"; }
| { readonly mechanism: "objectIntegrity"; readonly proofId: string | null; readonly proofIndex: number | null; }
The signature or proof being checked.
& (
| { readonly status: "rejected"; readonly reason: InboxVerificationFailureReason; }
| { readonly status: "error"; readonly error: unknown; }
A logical verification evaluation, separate from inbox authentication.
| { readonly type: "signatureVerificationFailed"; }
| { readonly type: "uncoveredAttribution"; readonly attributionIds: readonly URL[]; }
| { readonly type: "missingOwner"; }
| { readonly type: "proofPolicy"; readonly reason: InboxProofPolicyFailureReason; }
Why a complete verification evaluation was rejected.
| { readonly type: "multikey"; readonly id: URL | null; readonly controllerId: URL | null; readonly publicKey: CryptoKey; }
A snapshot of a key actually used to check a signature.
| JsonValue[]
| string
| number
| boolean
| null
The type of the result of parsing JSON.
A key for a key–value store. An array of one or more strings.
A callback that finalizes a media upload posted to the media upload endpoint (the ActivityPub Media Upload extension).
A message that represents a task to be processed by the background worker.
The concrete type of the message depends on the type property.
A callback that dispatches a NodeInfo object.
| Tombstone
| null
| Promise<TObject | Tombstone | null>
A callback that dispatches an object or a Tombstone.
| "blogger"
| "buddycloud"
| "diaspora"
| "dreamwidth"
| "drupal"
| "facebook"
| "friendica"
| "gnusocial"
| "google"
| "insanejournal"
| "libertree"
| "linkedin"
| "livejournal"
| "mediagoblin"
| "myspace"
| "pinterest"
| "pnut"
| "posterous"
| "pumpio"
| "redmatrix"
| "rss2.0"
| "smtp"
| "tent"
| "tumblr"
| "twitter"
| "wordpress"
| "xmpp"
The third party sites this server can publish messages to on the behalf of a user.
A callback that handles errors during outbox processing.
A callback that listens for activities in an outbox.
A callback that handles errors in an outbox listener.
A callback that handles permanent delivery failures when sending activities to remote inboxes.
| { readonly type: "object"; readonly class: ConstructorWithTypeId<Object>; readonly typeId: URL; readonly values: Record<string, string>; readonly authority?: string; }
| { readonly type: "inbox"; readonly identifier: undefined; readonly authority?: undefined; }
| { readonly type: "inbox"; readonly identifier: string; readonly authority?: string; }
| { readonly type: "outbox"; readonly identifier: string; readonly authority?: string; }
| { readonly type: "following"; readonly identifier: string; readonly authority?: string; }
| { readonly type: "followers"; readonly identifier: string; readonly authority?: string; }
| { readonly type: "liked"; readonly identifier: string; readonly authority?: string; }
| { readonly type: "featured"; readonly identifier: string; readonly authority?: string; }
| { readonly type: "featuredTags"; readonly identifier: string; readonly authority?: string; }
| { readonly type: "collection"; readonly name: string | symbol; readonly class: ConstructorWithTypeId<Object>; readonly typeId: URL; readonly values: Record<string, string>; readonly authority?: string; }
| { readonly type: "orderedCollection"; readonly name: string | symbol; readonly class: ConstructorWithTypeId<Object>; readonly typeId: URL; readonly values: Record<string, string>; readonly authority?: string; }
A result of parsing an URI.
A callback that maps an actor's internal identifier to the ID of the
FEP-ef61 portable actor it dispatches, or null if the actor is not
portable.
A callback that maps a custom collection to the identifier of the actor
that owns it, so that the collection can be served as an FEP-ef61
portable collection through the gateway endpoint, e.g.,
GET /.well-known/apgateway/did:key:z6Mk.../users/alice/bookmarks.
| "buddycloud"
| "dfrn"
| "diaspora"
| "libertree"
| "ostatus"
| "pumpio"
| "tent"
| "xmpp"
| "zot"
The protocols supported on this server.
A policy that determines the delay before the next retry.
| `{+${Param}}`
| `{#${Param}}`
| `{.${Param}}`
| `{/${Param}}`
| `{;${Param}}`
| `{?${Param}}`
| `{&${Param}}`
Defines a union of all valid RFC 6570 URI Template expressions for a given parameter name.
A callback that processes a custom background task.
A callback that handles activities whose signatures could not be verified.
The reason why an incoming activity could not be verified.
| { readonly type: "unknownCollectionSource"; readonly documentUrl: URL | null; }
| { readonly type: "unknownCollectionOwner"; }
| { readonly type: "conflictingCollectionOwners"; readonly candidates: readonly URL[]; }
| { readonly type: "collectionPageMismatch"; readonly pageId: URL; readonly collectionId: URL; readonly partOf: URL | null; }
| { readonly type: "collectionOwnerUnavailable"; readonly owner: URL; }
| { readonly type: "collectionNotListedByOwner"; readonly owner: URL; readonly collectionId: URL; }
| { readonly type: "untrustedGateway"; readonly owner: URL; readonly gateway: URL; readonly gateways: readonly URL[]; }
The reason why verifyPortableObject did not accept a document.
| { readonly type: "unsecuredCollection"; }
| { readonly type: "unsupportedObjectType"; readonly objectType: "verificationMethod" | "publicKey" | "link"; }
| { readonly type: "missingProof"; }
| { readonly type: "invalidGateways"; }
| { readonly type: "invalidProof"; readonly proofIndex: number; }
| { readonly type: "unsupportedVerificationMethod"; readonly proofIndex: number; readonly verificationMethod: URL; }
| { readonly type: "verificationMethodMismatch"; readonly proofIndex: number; readonly objectId: URL; readonly verificationMethod: URL; }
The reason why verifyPortableObjectProof could not verify a portable object proof.
| { readonly verified: false; readonly reason: VerifyPortableObjectProofFailureReason; }
The detailed result of verifyPortableObjectProof.
| { readonly verified: true; readonly method: "gateway"; readonly unsecured: true; readonly owner: URL; readonly gateway: URL; readonly collectionContext: unknown; }
| { readonly verified: false; readonly reason: VerifyPortableObjectFailureReason; }
The result of verifyPortableObject.
| { readonly verified: false; readonly reason: VerifyRequestFailureReason; }
The detailed result of verifyRequestDetailed.
| { readonly type: "invalidSignature"; readonly keyId?: URL; }
| { readonly type: "noSignature"; }
The reason why verifyRequestDetailed could not verify a request.
A callback that dispatches a array of Link.