Skip to main content
Build WebAssembly plugins using Go. Noorle uses TinyGo to compile Go to WASI Preview 2 WebAssembly.

Setup

Install TinyGo

Project Structure

Define Tools

Export functions as plugin tools.

Simple Functions

Complex Types

File I/O

Access filesystem via standard library.

Configure Permissions

In noorle.yaml:

Environment Variables

Access configuration via os.Getenv().
Configure in .env:

Network Access

Make HTTP requests via standard library.
Configure network permissions:

Error Handling

Return errors as structured responses.

Dependencies

go.mod

Add Dependencies

Size Optimization

Go WASM is typically 1-3MB. Minimize with:

Testing

Test locally before uploading.
Run tests:

Building and Deploying

Build

Upload

Best Practices

Input Validation

Logging

Documentation

Example: Complete Plugin

Troubleshooting

Build fails - “TinyGo not found”:
Plugin too large (>5MB):
  • Remove unnecessary dependencies
  • Use go mod tidy to clean up
  • Enable -s -w in LDFLAGS
Runtime issues with dependencies:
  • Ensure go.mod is correct
  • Use go get to fetch versions
  • Rebuild after dependency changes

Next Steps