Plugins
Add-ons for your workspace and your apps.
Plugins has six public methods. They list plugins and manage the plugins that run with a project on Xuda's servers, the second rail of the Plugins page. Each one acts for the account whose API key you use.
Adding a plugin to the workspace server, building one, running one and setting up its keys are done in the dashboard. They have no public method today, and install_plugin refuses a plugin that runs only on a workspace server.
Send a request to a method with your key. This one lists the marketplace's widgets:
A good answer has code 1. A refused one has a negative code and says why in data.
Find plugins
get_pluginslists the plugins in the marketplace. It takes optionalplugin_id(the full id, with its@xuda.io/prefix) orid(without it),category(a plugin type),limit(9999 if left out) andskipfor paging. Your own private plugins are listed for you and for nobody else.get_plugins_categorieslists the plugin types. It takes no fields.get_app_pluginslists the plugins installed in an app. It takesapp_idand an optionalplugin_type_filter.
Install and remove a project plugin
Installing asks for the plugin's terms to be agreed first, as the dashboard does.
- Call
get_install_consentwithitem_kindset topluginand theplugin_name. It returns the terms and acontent_hash. - Call
install_pluginwithapp_id,plugin_nameandconsent, an object withaccepted, thecontent_hashyou were given and alocale. Without a valid consent the install is refused and nothing is written.
install_plugin also takes consent_source (which screen the consent was accepted on, for the audit record only), validate_free (when true, a plugin with a price is refused) and version (for an update, the version you were offered: a version that is not the latest is refused).
uninstall_plugin takes app_id and plugin_name and removes the plugin from the app. It does not ask again.
Upload a private plugin
upload_plugin saves a plugin package. It reads data.plugin_name and data.plugin_type (one of dbs, widget, graphics, library, platform, framework, util, ui) from the body, with data.package_source (npm, the default, or xuda_hosted with a data.package_url) and data.visibility. Set data.visibility to private to keep it out of the marketplace.
A private upload needs the Agency membership or the workspace's Plugins Pro plan. Putting a plugin in the marketplace stays with the Agency membership. You can only update a plugin your own account uploaded.