A JSON Schema object describing the structure of the configuration data.
This is used by the server to render the plugin's configuration screen in the Admin UI.
The configuration data is stored by the server in $SIGNALK_NODE_CONFIG_DIR/plugin-config-data/<plugin-name>.json
. (Default value of SIGNALK_NODE_CONFIG_DIR
is $HOME/.signalk
.)
plugin.schema = {
type: 'object',
required: ['some_string', 'some_other_number'],
properties: {
some_string: {
type: 'string',
title: 'Some string that the plugin needs'
},
some_number: {
type: 'number',
title: 'Some number that the plugin needs',
default: 60
},
some_other_number: {
type: 'number',
title: 'Some other number that the plugin needs',
default: 5
}
}
};
Optional
enabledOptional
uiA uiSchema object which is used to control how the user interface is rendered in the Admin UI.
For more information, see react-jsonschema-form-extras
Used to identify the plugin in the server, for example when storing the plugin's configuration and in http endpoints.
Human oriented name for the plugin. This is used in the server's plugin configuration UI.
This function is called to start the plugin.
It is called:
the configuration data entered via the Plugin Config screen
a function that can be called by the plugin to restart itself
This function is called when the plugin is disabled or after configuration changes. Use this function to "clean up" the resources consumed by the plugin i.e. unsubscribe from streams, stop timers / loops and close devices. If there are asynchronous operations in your plugin's stop implementation you should return a Promise that resolves when stopping is complete.
Optional
descriptionOptional
getOptional
statusOptional
signalKApiOptional
registerPlugins can implement this method to provide an API. Like start and stop, this function will be called during plugin startup with an Express router as the parameter.
The router will be mounted at /plugins/<pluginId>
and you can use standard Express (.get()
.post()
.use()
, etc) methods to add HTTP path handlers.
GET /plugins/<pluginid>
and POST /plugins/<pluginid>/configure
are reserved by server (see below).
It should be noted that Express does not have a public API for deregistering subrouters, so stop does not do anything to the router.
If a plugin does provide an API, it is strongly recommended that it implement getOpenApi to document its operation. Doing so promotes interoperability with other plugins / webapps by making it easy to find and use the functionality built into plugins. It is also a means to avoid duplication, promote reuse and the possibility of including them in the Signal K specification.
Plugins are components that extend functionality of the server and can be installed via the Signal K AppStore.
A plugin can:
route,
waypoint
,POI
, orcharts
via the Resources API by operating as a Resources Provider Plugin.Typing is incomplete. If you find a missing or inaccurate type, please report it.
Example
Signal K server plugins are NodeJs
javascript
ortypescript
projects that return an object that implements this interface.See
Developing Server Plugins