PluginService instances shared across all plugins, and per-plugin PluginRuntimeService instances scoped to your plugin.
Plugin services (global)
Global services are singletons shared across all plugins. Access them withby plugin():
KlyxPlugin implementation, including init blocks.
When you access Logger via by plugin(), Klyx automatically wraps it in a PluginLogger that tags log entries with your plugin’s name. This means you do not need to specify a tag manually.
Runtime services (per-plugin)
Runtime services are unique to your plugin instance. Access them withby runtime():
PluginInfo gives you access to the plugin descriptor and file paths:
PluginContext
ThePluginContext gives your plugin access to the core application and runtime services:
Resolving services from PluginContext
You can resolve services inline from aPluginContext:
The event bus
The event bus is accessed through the plugin context:Plugin resources
ThePluginContext.context is an Android Context backed by the plugin’s own APK resources. Use withResources to make Compose resource lookups resolve against the plugin: