Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/entries/node.ts>IServerExtension

Storage for private, distributed, offline-first applications.
Go to Latest
interface IServerExtension
Re-export
import { type IServerExtension } from "https://deno.land/x/earthstar@v10.2.0/src/entries/node.ts";

Implement this interface to create an Earthstar server extension.

  • register is called once by the server, and this is where you can get a reference to its underlying Earthstar.Peer.
  • handler is called by the server when it is trying to fulfil an external request. If your extension does not interact with user requests you can return Promise.resolve(null).

Methods

register(peer: Peer): Promise<void>
handler(req: Request): Promise<Response | null>