Wasmer SDK runs registry packages inside sandboxes from JavaScript, Python, Swift, or Rust with a shared API model.
Overview
Wasmer SDK lets applications run real software inside lightweight WebAssembly sandboxes. Packages from the Wasmer registry can be composed into isolated environments where you supply files, environment variables, mounts, and network capabilities, then execute commands or keep long-lived processes under explicit control.
The design uses one conceptual model across languages: a client resolves packages and caching, sandboxes.create() assembles an isolated workspace, command(...).run() runs finite commands, and command(...).spawn() exposes stdin, stdout, stderr, and lifecycle for ongoing processes. Filesystem and guest port helpers sit on the sandbox rather than a separate hidden server abstraction.
Language bindings include JavaScript on npm, Python on pip, Rust via the workspace, and a Swift preview for macOS with a noted path toward iOS. JavaScript runs Wasmer in WebAssembly via wasm-bindgen with Node networking bridged through node:net and node:dns; Python and Swift share a UniFFI layer on the Rust SDK. Examples in the documentation cover browser shells, Python HTTP servers, PostgreSQL with psql, PHP sites, and mixed runtimes in one sandbox.
Shared package caching defaults to a .wasmer directory in the working folder, with registry metadata shared across native clients. The SDK remains in alpha, with cross-language shape settled but error codes and edge capabilities still evolving.
Key features
- Composable WASM sandboxes
- Wasmer registry package resolution
- Run and spawn guest commands
- Guest filesystem and port access
- JavaScript, Python, Rust, Swift SDKs
- Shared local package cache
Use cases
- Running Python in a sandbox from Node
- Browser Unix-style command examples
- PostgreSQL in an isolated guest
- Multi-runtime demos in one workspace