Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/earthstar/src/server/extensions/extension.ts>ServerExtension

Storage for private, distributed, offline-first applications.
Go to Latest
interface ServerExtension
import { type ServerExtension } from "https://deno.land/x/earthstar@11.0.0-beta.2/src/server/extensions/extension.ts";

Implement this interface to create an Earthstar server extension.

Methods

register(peer: Peer): Promise<void>

Called once by the Server, and this is where you can get a reference to its underlying @{linkcode Peer}.

handler(req: Request): Promise<Response | null>

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<null>.