Skip to main content

WASM Plugins

Collabase features a native WebAssembly (WASM) plugin engine that allows you to securely extend the core backend. Unlike Frontend SDK Apps which run visually in an iFrame, WASM plugins run completely headless on your server. They interface directly with the Collabase backend engine via a high-performance, strictly controlled execution sandbox.

Why WebAssembly?

  • Sandboxed Execution: Plugins cannot crash the main Node.js event loop or application thread. Memory leaks, infinite loops, or segmentation faults inside the plugin are securely isolated.
  • Zero Overhead Background Processing: Ideal for listening to system events (e.g., synchronously mutating a task payload before it saves) without the latency and network overhead of traditional HTTP webhooks.
  • Polyglot Freedom: Write your backend logic in AssemblyScript, Rust, Go, or C/C++, and compile it down to a standard .wasm binary.

The Sandbox Environment

When the Collabase engine executes a WASM plugin, it runs within strict boundaries enforced by the host:
  • memoryLimit: Configurable per plugin (default 64MB).
  • timeout: Configurable execution time limit to prevent CPU monopolization (default 5000ms).
Plugins do not have arbitrary native file system access, raw network socket access, or unrestricted environment variable access unless explicitly granted via Host Functions.

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 backend architecture. Define your hook points in your plugin’s metadata manifest:
Whenever a user modifies a task or an automation flow hits your custom node, the Collabase engine invokes your WASM module’s entry point, passing the serialized payload and execution context.

Available Hook Points

Below is the list of hooks currently exposed to the WASM engine:

Host Functions

The engine provides specific “Host Functions” that bridge your isolated WASM sandbox to the underlying Collabase platform APIs.

Context and Logging

The most important host function is collabase:log. This allows your plugin to stream execution logs directly to the Admin Dashboard’s live log viewer. AssemblyScript Example:

Compiling Your Plugin

Depending on your language of choice, compile your source code to the wasm32-unknown-unknown or equivalent target.
1

Write Logic

Implement your logic using the exposed Collabase host functions and your preferred language.
2

Compile (AssemblyScript)

Use the AssemblyScript compiler:
3

Compile (Rust)

Use the standard Cargo build target:

Installing and Updating

Once your .wasm binary is compiled, you must deploy it to the Collabase instance.

Via the Admin Interface

1

Open Plugins

Navigate to System Administration → Plugins.
2

Select Tab

Switch to the WASM Plugins tab.
3

Click Install

Click Install WASM Plugin.
4

Upload

Upload your compiled .wasm file along with its metadata JSON.

Reviewing Live Execution Logs

In the WASM Plugins tab, expand any installed plugin row to reveal the Live Log Viewer. Every time your plugin calls the collabase:log host function (or encounters a sandbox panic, segmentation fault, or timeout), the engine instantly streams the stdout/stderr here. You can filter logs by Level (INFO, ERROR, DEBUG) to monitor background execution in production environments.
Last modified on June 19, 2026