JSR

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

Examples

Example 1

federation
  .setInboxListeners("/users/{identifier}/inbox", "/inbox")
  .on(Follow, async (ctx, follow) => {
    const from = await follow.getActor(ctx);
    if (!isActor(from)) return;
    // ...
  })
  .on(Undo, async (ctx, undo) => {
    // ...
  });

Parameters

The URI path pattern for the inbox. The syntax is based on URI Template (RFC 6570). The path must have one variable: {identifier}, and must match the inbox dispatcher path.

An optional URI path pattern for the shared inbox. The syntax is based on URI Template (RFC 6570). The path must have no variables.

Return Type

An object to register inbox listeners.

Throws

Thrown if the path pattern is invalid.

Read the original on jsr.io ↗