Skip to main content

Interface: IPluginContext

Defined in: src/types/interfaces/plugin.interface.ts:214

Plugin context (dependency injection).

Remarks​

Passed to plugin during initialization. Provides access to Chive services and infrastructure.

Since​

0.1.0

Properties​

cache​

readonly cache: ICacheProvider

Defined in: src/types/interfaces/plugin.interface.ts:229

Cache provider for this plugin.

Remarks​

Keys are automatically prefixed with plugin ID.


config​

readonly config: Record<string, unknown>

Defined in: src/types/interfaces/plugin.interface.ts:250

Plugin-specific configuration.

Remarks​

Loaded from Chive configuration file or environment variables.


eventBus​

readonly eventBus: IPluginEventBus

Defined in: src/types/interfaces/plugin.interface.ts:242

Event bus for subscribing to hooks.


logger​

readonly logger: ILogger

Defined in: src/types/interfaces/plugin.interface.ts:221

Logger instance for this plugin.

Remarks​

Pre-configured with plugin ID in context.


metrics​

readonly metrics: IMetrics

Defined in: src/types/interfaces/plugin.interface.ts:237

Metrics provider for this plugin.

Remarks​

Metrics are automatically labeled with plugin ID.