Plugin API Technical Reference
Comprehensive technical specification for the XyPriss Plugin Architecture, including interface definitions, hook protocols, and execution prioritization.
Performance Categorization
The engine uses PluginType metadata to optimize internal execution order.
All transaction hooks are tuned for sub-millisecond execution.
XyPrissPlugin Interface Specification
The XyPrissPlugin interface defines the contract between the core engine and external modules. Plugins must adhere to this structure for pipeline compatibility.
export interface XyPrissPlugin {
// Identity Metadata
name: string;
version: string;
type?: PluginType; // SECURITY | NETWORK | CACHE | etc.
// Lifecycle Hooks
onRegister?(error?: Error | null): void | Promise<void>;
onServerStart?(server: PluginServer): void | Promise<void>;
onServerReady?(server: PluginServer): void | Promise<void>;
onServerStop?(server: PluginServer): void | Promise<void>;
// Transaction Interception
onRequest?(req: Request, res: Response, next: NextFunction): void | Promise<void>;
onResponse?(req: Request, res: Response): void | Promise<void>;
onError?(error: Error, req: Request, res: Response, next?: NextFunction): void | Promise<void>;
// Security & Metrics
onSecurityAttack?(attackData: any, req: Request, res: Response): void | Promise<void>;
onResponseTime?(time: number, req: Request, res: Response): void | Promise<void>;
onRateLimit?(limitData: any, req: Request, res: Response): void | Promise<void>;
// Subsystem Logic
registerRoutes?(app: XyPrissApp): void;
middlewarePriority?: "first" | "normal" | "last";
}Functional Domain Reference
The XyPriss hook ecosystem is categorized by functional domains. Explore the detailed technical documentation for each hook category below.
Unified Registry
Unified Hook Registry
A single, searchable index of every hook, property, and capability ID available in XyPriss. Ideal for quick reference and scalable permission mapping.
Middleware Priority Protocols
Developers can control the relative execution order of their plugin middleware within the pipeline using the middlewarePriority property.
| Level | ID | Description |
|---|---|---|
| First | "first" | Executes before all other registered plugin middleware. |
| Normal | "normal" | Default priority. Executes in registration order. |
| Last | "last" | Executes after all other registered plugin middleware. |
Return to the core architectural concepts of the XyPriss plugin engine.
