Skip to main content
Build WebAssembly plugins using Rust. Rust provides excellent WebAssembly support with cargo-component and native WASI Preview 2 tooling.

Setup

Install Rust and WASM Target

Project Structure

Define Tools

Export functions as plugin tools.

Simple Functions

Complex Types

Structured Data

Use serde for JSON serialization:

File I/O

Access filesystem via standard library.

Configure Permissions

In noorle.yaml:

Environment Variables

Access configuration via std::env:
Configure in .env:

Network Access

Make HTTP requests via standard library or libraries.

Using reqwest (Rust standard)

Add to Cargo.toml:
Configure network permissions:

Dependencies

Cargo.toml

Add Dependencies

Size Optimization

Typical Rust plugin size: 500KB - 2MB

Error Handling

Return structured errors:

Testing

Test locally before uploading.
Run tests:

Building and Deploying

Build

Upload

Best Practices

Input Validation

Logging

Documentation

Example: Complete Plugin

Troubleshooting

Build fails - “Target not found”:
Large WASM binary (>5MB):
  • Review dependencies
  • Use cargo-bloat to analyze
  • Enable release optimizations
Async runtime issues:
  • TinyGo/WASI have limited async support
  • Use tokio 1.0+ with WASI target
  • Consider blocking alternatives for simple cases

Next Steps