navidrome/plugins/schemas/lifecycle.yaml
Deluan 9da40af6fb feat: add Crypto Ticker example plugin for real-time cryptocurrency price updates via Coinbase WebSocket API
Also add the lifecycle capability

Signed-off-by: Deluan <deluan@navidrome.org>
2025-12-31 17:06:29 -05:00

42 lines
1.4 KiB
YAML

version: v1-draft
exports:
nd_on_init:
description: |
Called after a plugin is fully loaded with all services registered.
Plugins can use this function to perform one-time initialization tasks,
such as establishing connections, starting background processes, or
validating configuration.
This function is called once when the plugin is loaded, and is NOT
called when the plugin is hot-reloaded. Plugins should not assume
this function will be called on every startup.
The input is currently empty (reserved for future use). The output
can contain an error string if initialization failed, which will be
logged but will not prevent the plugin from being loaded.
input:
$ref: "#/components/schemas/OnInitInput"
contentType: application/json
output:
$ref: "#/components/schemas/OnInitOutput"
contentType: application/json
components:
schemas:
OnInitInput:
description: Input provided to the init callback (currently empty, reserved for future use)
type: object
properties: {}
OnInitOutput:
description: Output from the init callback
type: object
properties:
error:
type: string
nullable: true
description: |
Error message if initialization failed. Empty or null indicates success.
The error is logged but does not prevent the plugin from being loaded.