Skip to content

Config Schema

Declare config fields in the openvideoPlugin.schema array; the admin renders a form automatically and saving hot-reloads the plugin.

json
{
  "openvideoPlugin": {
    "schema": [
      { "key": "interval",  "label": "Interval (sec)", "type": "number", "default": 60, "hint": "Timer interval" },
      { "key": "verbose",   "label": "Verbose", "type": "boolean", "default": true },
      { "key": "level",     "label": "Level", "type": "select", "default": "info",
        "options": [ { "value": "debug", "label": "Debug" }, { "value": "info", "label": "Info" } ] },
      { "key": "message",   "label": "Message", "type": "textarea", "default": "Hello" }
    ]
  }
}

Field Attributes

AttributeTypeDescription
keystringconfig key (required)
labelstringform label
typestringstring / number / boolean / select / textarea (default string)
defaultanydefault value
hintstringhint text below the field
optionsarrayselect options: [{ value, label }]

Reading Config

config in apply(ctx, config) is the merged config; ctx.config gives runtime access.

Notes

  • Config persists in data/plugins.json per plugin
  • Saving hot-reloads the plugin
  • Without a schema, no "Config" button is shown

MIT License · Made with ♥ by yangyang8002