BrowserPod 3.0 runs Rust BrowserPod 3.0 runs unmodified Rust programs in the browser Announcement
Using a coding agent? Not sure where to start? Talk to us
Sign up for Edge Get an Edge API key, with 1,000 free hours Contact us Talk to the team

Embeddable

A pod in any page

BrowserPod is a library, so a pod goes wherever your users already are: docs, tutorials, demos or your own product.

A library, not a service

01

One npm package

npm i @leaningtech/browserpod, then boot a pod from your own code.

02

Your terminal, your UI

Use the built-in xterm.js terminal, or bring your own, such as ghostty-web.

03

Runnable documentation

Readers run the example in the page instead of copying it into their own setup.

04

Two headers to set

Serve the page with COOP and COEP headers, so it's cross-origin isolated and pods get shared memory.

How embedding works

BrowserPod is an npm package: a small loader that fetches the runtime from our CDN, the way CheerpJ does. Adding it to your app is one dependency and a few lines of JavaScript, with no service to sign up for.

A pod draws into whatever element you give it. createDefaultTerminal attaches an xterm.js terminal to any element, and createCustomTerminal hands you the raw output to drive your own. Files, processes and output are all reachable from your code through the same API.

Because the pod lives in the page, it fits anywhere a script does: next to a code sample in your docs, inside a tutorial step, in a product demo or as a feature of your own app.

What you need to know

Serve the page cross-origin isolated

Set Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp. Third-party scripts on the page need CORP headers to load.

Attribution

The Community Licence asks for attribution, and the runtime shows a short notice in the browser console.

Drop it into a page

Point the terminal at any element. The pod runs inside it, in your layout.

app.js
import { BrowserPod } from "@leaningtech/browserpod";

const pod = await BrowserPod.boot();
const terminal = await pod.createDefaultTerminal(document.querySelector("#example"));

await pod.run("bash", [], { terminal, cwd: "/home/user" });

Questions

Which headers does the page need?

Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp, so the page is cross-origin isolated.

Can I use it in an open-source project's docs?

Yes. The library is free for any use, and open-source projects can apply for a grant for Edge.

Can I use my own terminal?

Yes. createCustomTerminal gives you the pod's raw output to drive any terminal, such as ghostty-web, or your own UI.

Is there a ready-made playground I can embed?

Yes. BrowserCode, our open playground built on BrowserPod, supports embeds and is free and unlimited in any public link or embed.

Stay informed with BrowserPod news

BrowserCode: a browser-based coding playground, powered by WebAssemblyBrowserCode is a free, open source, fully client-side coding playground. Open a tab, pick a template, clone a repo or pick an agent and start building. No account, no installs, no servers, no setup. Ana GabySoftware Engineer @ Leaning TechnologiesBeyond WASI: Running any Rust application in the browser with BrowserPod 3.0BrowserPod can now run real Rust programs in the browser, compiled from unmodified source with stock rustc and cargo. Yuri IozzelliSenior Software Engineer @ Leaning TechnologiesA Linux-like kernel in a browser tab - deep dive in the BrowserPod architectureHow the BrowserPod kernel supports running many Linux applications concurrently in the browser using WebAssembly. Alessandro PignottiCTO @ Leaning TechnologiesBrowserPod 2.0: in-browser WebAssembly sandboxes. Run git, bash, node, python...BrowserPod 2.0 ships with a real bash shell, git, and core Linux utilities. Yuri IozzelliSenior Software Engineer @ Leaning TechnologiesBrowserPod: universal in-browser sandbox powered by Wasm (starting with Node.js)Stefano De Rossi, Alessandro PignottiCEO @ Leaning TechnologiesBrowserPod: WebAssembly in-browser code sandboxes for Node, Python, and RailsBrowserPod Beta is live: zero latency in-browser code sandboxes in WebAssembly for Node, Python and Rails. Alessandro Pignotti, Stefano De RossiCTO @ Leaning TechnologiesBrowserPod: In-browser full-stack environments for IDEs and Agents via WasmBrowserPod is a WebAssembly-based, client-side container that brings full-stack dev environments to the browser, ideal for web IDEs, docs, and AI agents.Alessandro Pignotti, Stefano De RossiCTO @ Leaning Technologies