IPluginContext
Interface: IPluginContext<TDb, TConfig>
Defined in: plugins/types.ts:62
Plugin context provided to all lifecycle hooks Contains database, logger, and other shared resources
Property Availability
| Property | Availability | Notes |
|---|---|---|
db | Optional - provided when db access is needed | Guard for undefined; throw PluginError if required but missing |
logger | Required - guaranteed in all hooks | Always present; use context.logger.info() |
config | Guaranteed after onInstall | May be undefined in onInstall; always present in other hooks |
Recommended Fallbacks
- If
dbis undefined when required, throw a descriptive error - If
configis missing, use sensible defaults or throw during onActivate