Browse documentation

RequestPlugin

Type. Request lifecycle plugin hooks.

Table of contents

Category

Type

Type import

ts
import type { RequestPlugin } from "valyrian.js/request";

Public signature

ts
interface RequestPlugin { name?: string; request?: (context: RequestContext) => RequestContext | Promise<RequestContext | void> | void; response?: (context: ResponseContext) => ResponseContext | Promise<ResponseContext | void> | void; error?: (context: ErrorContext) => ErrorContext | Promise<ErrorContext | void> | void; }

Type usage

RequestPlugin defines optional request, response and error hooks used in registration order by a RequestInterface.