The Fleet Manager supports plugins written or built into javascript (you can write your plugin in typescript but you have to build its backend in javascript). Plugins are executed in a worker thread attached to the main process. Plugins can register components that are accessible from everywhere in Fleet Management and can also make calls to other registered components.
This documentation explains all the steps in the development of a plugin for the Shelly Fleet Management and all the requirements for that plugin to run properly once uploaded to your Fleet Management instance.
For easier development, you will be provided with a basic demo plugin that includes all necessary functions and inline documentation for them (you can find it in plugins/). The mock plugin provided to you does not show by default on the left side bar. If you want to be able to access it through the UI, make sure to check the last point of this documentation before deploying the plugin.
Each plugin has to have a valid package.json file that has `name`, `version`, `description`, and `main`. If any of these properties are missing, the plugin will not be loaded. The plugin should also have a `.js` file as an entrypoint, as described in the `main` property of `package.json`.
Do not put spaces (" ") in the name of the plugin or in the name of the folder you are going to archive and upload to the Fleet Manager. The archive you are going to upload has to be of type .zip (not .7z, not .rar, etc.).
Once you have finished with development or if you want to test your plugin, first, make sure to have followed the requirements, and then upload it to the Fleet Manager:
After that your plugin will get uploaded, unarchived and built. That will also trigger a frontend rebuild, so give it in the worst cases a few minutes. After a few minutes, make a hard reload of the page and you will see your plugin on the left side bar (only if you have added it to the side bar via the package.json!).
Add this to your package.json:
"config": {
"menuItems": [
{
"link": "/plugin/em-reports",
"name": "EM Reports",
"icon": "fa-solid fa-shopping-cart"
}
]
},
Choose an icon that suits your plugin and replace the one put in the example with it.
Replace em-reports in the name with the name of your plugin.
In the name section of the menu items element add the name the way you want it to be displayed on the sidebar.