Skip to main content

Interface: IServerPluginContext

Defined in: Plugin/PluginTypes.ts:105

Capabilities available to server-side plugins. The concrete implementation lives in @bible/web (or @bible/desktop).

The generic parameters for hooks are intentionally any here — concrete filter/action maps are defined in the platform packages where the actual hook points are known.

Extends

Properties

dataDir

dataDir: string

Defined in: Plugin/PluginTypes.ts:120

Plugin's persistent data directory path


hooks

hooks: HookRegistry<any, any>

Defined in: Plugin/PluginTypes.ts:117

Hook registry for server-side filter and action hooks


log

log: PluginLogger

Defined in: Plugin/PluginTypes.ts:90

Scoped logger that prefixes output with the plugin ID

Inherited from

BasePluginContext.log


pluginId

pluginId: string

Defined in: Plugin/PluginTypes.ts:87

The plugin's unique ID

Inherited from

BasePluginContext.pluginId

Methods

openDatabase()

openDatabase(filename): ISql

Defined in: Plugin/PluginTypes.ts:113

Open a plugin-owned SQLite database in the plugin's data directory

Parameters

filename

string

Returns

ISql


registerMiddleware()

registerMiddleware(path, handler): void

Defined in: Plugin/PluginTypes.ts:110

Register middleware on existing routes (runs before core handlers)

Parameters

path

string

handler

unknown

Returns

void


registerRoutes()

registerRoutes(path, router): void

Defined in: Plugin/PluginTypes.ts:107

Register Express routes under /api/plugins//...

Parameters

path

string

router

unknown

Returns

void