Runtime API
These APIs are available on pluginApi inside setup and inside activity render functions.
pluginApi.config
Read and react to config values at runtime.
config.get
Returns the current value of any config option, including custom ones registered by your plugin.
config.subscribe
Calls a callback immediately with the current value and again whenever that config value changes. Returns an unsubscribe function. Subscriptions created during setup are cleaned up automatically when the plugin is unregistered. Subscriptions created inside an activity’s render function should be unsubscribed in that activity’s cleanup function.
Inside an activity’s render function, tie the subscription to that mount and unsubscribe in the returned cleanup function:
pluginApi.activity
Access the parameters passed to the currently active activity via navigate().
activity.getParams
Returns the current activity parameters synchronously. Useful for reading params once at setup time or at the start of an activity render.
activity.subscribeToParams
Subscribes to parameter changes. The callback fires immediately with the current params, then on every subsequent update. Returns an unsubscribe function.
The render function receives params as its second argument for the initial mount, but if your activity can be re-activated with new params while already mounted, use subscribeToParams inside render to react to those updates:
pluginApi.files
Mutate file entries in the upload collection.
files.update
Updates mutable properties of a file entry by its internalId.
pluginApi.router
Since v1.37.0
Navigation intents for flows where the solution decides where a step leads.
To open a specific activity, use uploaderApi.navigate() instead.
router.traverse
traverse(edge: 'onBack' | 'onCancel' | 'onClose' | 'onDone' | 'onFileAdd') => void
Resolves the intent the same way the built-in sources do:
onBack,onCancel: go back to the previous screen.onClose: close the uploader.onDone: go to the solution’s done screen.onFileAdd: show the upload list, or whatever the solution shows after a file is added (the minimal solution keeps its modal closed).
Call traverse('onFileAdd') after adding files, rather than navigating to upload-list yourself:
pluginApi.logger
Since v1.37.0
A logger scoped to the plugin: its messages start with [uc][<ctx-name>][plugin:<plugin-id>].
Prefer it to console.*, so the output names the uploader and the plugin, and debug output stays off by default.