|
| 1 | +--- |
| 2 | +title: BrowserPod |
| 3 | +shortTitle: Overview |
| 4 | +description: Run Dev Environments in your browser |
| 5 | +--- |
| 6 | + |
| 7 | +import LinkButton from "@leaningtech/astro-theme/components/LinkButton.astro"; |
| 8 | +import { DISCORD_URL } from "@/consts.ts"; |
| 9 | + |
| 10 | +<div class="not-prose flex gap-2 mb-2"> |
| 11 | + <img |
| 12 | + src="https://img.shields.io/badge/version-0.1-orange" |
| 13 | + alt="Version 0.1" |
| 14 | + /> |
| 15 | + <a href="https://discord.leaningtech.com/"> |
| 16 | + <img |
| 17 | + src="https://img.shields.io/discord/988743885121548329?color=%237289DA&logo=discord&logoColor=ffffff" |
| 18 | + alt="Discord server" |
| 19 | + /> |
| 20 | + </a> |
| 21 | + <a href="https://github.com/leaningtech/browserpod-meta/issues"> |
| 22 | + <img |
| 23 | + src="https://img.shields.io/github/issues/leaningtech/browserpod-meta.svg?logo=github" |
| 24 | + alt="GitHub issues" |
| 25 | + /> |
| 26 | + </a> |
| 27 | +</div> |
| 28 | + |
| 29 | +<div class="text-lg"> |
| 30 | + Instant, in-browser runtime for Node.js, Python, and Ruby on Rails to power the future of Web-based developer experiences. |
| 31 | + |
| 32 | + Run Node.js projects in your browser, unmodified (Python, Ruby, and more coming in the future). |
| 33 | + |
| 34 | + Access the local http server in the same page or from another tab to view, test, and iterate; or share it with others, thanks to Portals. |
| 35 | + |
| 36 | + See it in action in our [SvelteKit+Vite demo](https://vitedemo.browserpod.io) |
| 37 | +</div> |
| 38 | + |
| 39 | +<div class="m-4 flex justify-center"> |
| 40 | + [Get started](/docs/getting-started) · [API |
| 41 | + Reference](/docs/reference) · [GitHub |
| 42 | + repository](https://github.com/leaningtech/browserpod-meta) |
| 43 | +</div> |
| 44 | + |
| 45 | +```html |
| 46 | +<script src="https://rt.browserpod.io/20251014_102/browserpod.js"></script> |
| 47 | +``` |
| 48 | + |
| 49 | +## Use Cases |
| 50 | + |
| 51 | +### Project showcase |
| 52 | + |
| 53 | +Run a demo of your project directly in the user's browser, without any explicit setup or installation, and secured by the browser's sandbox. |
| 54 | + |
| 55 | +### Interactive documentation / tutorials |
| 56 | + |
| 57 | +Enrich your documentation and tutorials with interactive components, without the need for any server-side infrastructure. |
| 58 | + |
| 59 | +### AI Agents environment |
| 60 | + |
| 61 | +Let AI assistants and Agents run loose on your project, but isolated from the rest of your system. |
| 62 | + |
| 63 | + |
| 64 | +## Getting started |
| 65 | + |
| 66 | +BrowserPod has a simple yet powerful [API](/docs/reference). |
| 67 | + |
| 68 | +You can get up an running with few simple steps. |
| 69 | + |
| 70 | +First, you need to boot your pod: |
| 71 | + |
| 72 | +```js |
| 73 | +const pod = await BrowserPod.boot({ apiKey:"...", nodeVersion:"22", /*...*/}); |
| 74 | +``` |
| 75 | + |
| 76 | +Then, you need to add your project's files to the pod. Currently, you need to fetch the contents yourself, and re-create the directory structure inside the pod's filesystem. We will add more convenient setup methods in the future: |
| 77 | + |
| 78 | +```js |
| 79 | +await pod.createDirectory("/project"); |
| 80 | +for await (const f of myfiles) { |
| 81 | + const response = await fetch(f.url); |
| 82 | + const buffer = await response.arrayBuffer(); |
| 83 | + const fd = await pod.createFile(f.path); |
| 84 | + fd.write(buffer); |
| 85 | + fd.close(); |
| 86 | +} |
| 87 | +``` |
| 88 | + |
| 89 | +Then, run any setup step required to initialize your project: |
| 90 | + |
| 91 | +```js |
| 92 | +await pod.run("npm", ["install"], { cwd: "/project" }); |
| 93 | +``` |
| 94 | + |
| 95 | +And finally, run the dev server (or whatever workload your project provides): |
| 96 | + |
| 97 | +```js |
| 98 | +await pod.run("npm", ["run", "dev"], { cwd: "/project" }); |
| 99 | +``` |
| 100 | + |
| 101 | + |
| 102 | +Listening ports are associated with a Portal, which you can embed in the page with an IFrame, or visit from another Tab, or even another device, anywhere in the World. |
| 103 | +To get notified when a portal is created, do: |
| 104 | + |
| 105 | +```js |
| 106 | +pod.onPortal(({url, port} => { /*...load iframe...*/ }); |
| 107 | +``` |
| 108 | +
|
| 109 | +## How does BrowserPod work? |
| 110 | +
|
| 111 | +BrowserPod is built on top of CheerpOS, an Operating System interface that provides the Linux syscall interface to Wasm programs running in the Browser. |
| 112 | +
|
| 113 | +BrowserPod ships with a build of Node.js that targets CheerpOS. |
| 114 | +
|
| 115 | +Instead of using an embedded V8 engine to run JavaScript, the Browser's engine is used instead. |
| 116 | +
|
| 117 | +This allows BrowserPod to run your JavaScript code at native speed. |
| 118 | +
|
| 119 | +Everything else (Node's builtin JS modules, libuv, and Node's internal C++ code) stays the same, to guarantee maximum compatibility. |
| 120 | +
|
| 121 | +Multiple versions of Node will be supported, and we plan to support new LTS versions in a timely manner. |
| 122 | +
|
| 123 | +Using the same foundation, we plan to support other languages and frameworks, like Python and Ruby (including Ruby on Rails). |
| 124 | +
|
| 125 | +## Licensing |
| 126 | +
|
| 127 | +BrowserPod is free for personal use and technical evaluation. See [licensing](/docs/licensing) for details. |
| 128 | +
|
| 129 | +## Demos |
| 130 | +
|
| 131 | +You can see BrowserPod in action in our [SvelteKit+Vite demo](https://vitedemo.browserpod.io) |
| 132 | +
|
| 133 | +## Community |
| 134 | +
|
| 135 | +We have a vibrant Discord community where you can ask questions, share your projects, and get community support. |
| 136 | +
|
| 137 | +<LinkButton |
| 138 | + type="discord" |
| 139 | + href={DISCORD_URL} |
| 140 | + iconLeft="fa-brands:discord" |
| 141 | + label="Join our Discord server" |
| 142 | +/> |
| 143 | +
|
| 144 | +<LinkButton |
| 145 | + type="secondary" |
| 146 | + href="https://twitter.com/leaningtech" |
| 147 | + iconLeft="fa-brands:twitter" |
| 148 | + label="Follow us on Twitter" |
| 149 | +/> |
| 150 | +
|
| 151 | +--- |
| 152 | +
|
0 commit comments