Afaik the official way in Plasma 5 was using the executable Datasource (ala [1]).
As far as I understand Datatsource is deprecated in Plasma 6 but still available through org.kde.plasma.plasma5support.
Question: Is there an official replacement or should we use the Plasma5Support compatibility layer for now?
[1] https://github.com/Zren/plasma-applet-lib/blob/master/package/contents/ui/lib/ExecUtil.qml