Lifecycle hooks

Plugins hook into the server lifecycle through defined phases. Each plugin declares which phases it responds to in its manifest.

onBoot

Called once when the server process starts. Use for dependency injection setup and initialisation.

onScan

Called after each library scan pass. Use to enrich items with additional metadata from external sources.

onTranscode

Called before transcoding. Use to register custom codec profiles or pre-process the input stream.

onPlay

Called before playback starts. Use for session initialisation, analytics, or access control checks.

onStop

Called when the server process stops. Use for graceful cleanup, state persistence, and resource release.

plugin.json

Minimal manifest

{
  "name": "my-metadata-provider",
  "version": "1.0.0",
  "description": "Fetches artwork from Fanart.tv",
  "lifecycle": ["onScan"],
  "apiVersion": "1.0",
  "author": "Your Name <your@email.com>"
}

That's the smallest valid Phlix plugin. Drop it into plugins/, and Phlix loads it on the next boot.

phlix-plugin-example on GitHub Plugin documentation