Browser-native Node.js

Run Node in the browser

Add a filesystem, shell, package manager, dev server, editor, terminal, and live preview to your product.

  • Runs in the browser
  • Starts in seconds
  • Works with npm
your-product.tsx
01import { Sandbox } from '@node-sandbox/elements';02 03export default () => (04  <Sandbox05    apiKey={apiKey}06    source={project}07  />08);
ClientRuntime API
ReactState + preview
ElementsComplete IDE UI
VITE v8.1.3 ready in 412msLIVE

Choose your layer

Choose your integration surface.

Build a browser runtime with Client, React, and Elements, or manage persistent projects from your server with the Platform SDK.

Five-minute quickstart

Create your first sandbox.

3 steps
1

Install the client

Add the low-level SDK to any browser application.

bash
npm install @node-sandbox/client
2

Create and start

Seed a project, install its dependencies, then explicitly start its dev script.

sandbox.ts
import { Sandbox } from '@node-sandbox/client';

const sandbox = await Sandbox.create({
  apiKey: import.meta.env.VITE_NODESANDBOX_API_KEY,
  source: {
    type: 'files',
    files: {
      'package.json': JSON.stringify({
        scripts: { dev: 'vite --host 0.0.0.0' },
        dependencies: { vite: '8.1.3' },
      }),
      'index.html': '<h1>Hello from NodeSandbox</h1>',
    },
  },
});

const preview = await sandbox.start();
console.log(preview.url);
3

Render the preview

Use the returned per-sandbox URL in your own iframe, or let React and Elements render it.

preview.ts
const frame = document.createElement('iframe');
frame.src = preview.url;
mount.append(frame);

// Kills your dev server and tears down the runtime.
sandbox.dispose();
frame.remove();