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
One npm package
npm i @leaningtech/browserpod, then boot a pod from your own code.
Your terminal, your UI
Use the built-in xterm.js terminal, or bring your own, such as ghostty-web.
Runnable documentation
Readers run the example in the page instead of copying it into their own setup.
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
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.
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.
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.










