WASM Plugins
Collabase features a native WebAssembly (WASM) plugin engine that allows you to extend the core backend securely. Unlike Frontend SDK Apps which run visually in an iFrame, WASM plugins run completely offline on your server, directly interfacing with the Collabase engine via a high-performance sandbox.Why WebAssembly
- Sandboxed Execution: Plugins cannot bring down the main application thread. Memory leaks, infinite loops, or crashes run securely isolated.
- Zero Overhead Background Processing: Ideal for listening to system events (e.g., when a task is updated) without the overhead of HTTP webhooks.
- Polyglot Freedom: Write your backend plugins in AssemblyScript, Rust, Go, or C/C++ and compile to standard
.wasm.
The Sandbox Environment
When a WASM plugin is executed, it runs with strict boundaries:memoryLimit: Configurable per plugin (default 64MB).timeout: Configurable execution time limit (default 5000ms).
Hook points
WASM Plugins are triggered by “Hook Points.” A Hook Point is a subscription to a system event or an interception path within the main application.Available hook points
Here is a complete list of hooks currently exposed to the WASM engine.| Hook | Payload description | Typical use case |
|---|---|---|
task:created | The full Task object. | Automatic tagging, routing, or validation upon task creation. |
task:updated | The Task object and changed fields. | Auditing status transitions or computing derived states. |
task:deleted | The taskId string. | Cleaning up related external system records. |
page:created | The Page object (excluding content body). | Initiating approval workflows for new documentation. |
page:updated | The Page object and diff structure. | Tracking stale documentation or triggering translation tasks. |
page:deleted | The pageId string. | Archiving logic. |
user:created | The User profile object. | Provisioning the user in external LDAP or SCIM integrations. |
project:created | The Project object. | Bootstrapping default folders or task queues for new projects. |
automation:custom_node | The node context, params, and variables. | Executing highly specialized, memory-intensive logic required by an automation flowchart. |
Host functions
The engine provides specific “Host Functions” bridging your WASM sandbox to the Collabase platform.Context and logging
The most important host function iscollabase:log. This allows you to stream execution logs directly to the Admin Dashboard’s live log viewer.
AssemblyScript Example:
Building the plugin
Installing and updating
Via the admin interface
Reviewing live logs
In the WASM Plugins tab, you can expand any installed plugin row. This reveals a Live Log Viewer. Every time your plugin callscollabase:log (or encounters a sandbox panic/timeout), it is instantly streamed here. You can filter logs by Level (INFO, ERROR, DEBUG) to easily monitor background execution in production.
