JavaScript / TypeScript SDK¶
Private beta
Signups are invite-only. Request an invite. The JS SDK is on npm; you still need a dashboard API key to run anything.
The official JS/TS client — a thin, zero-dependency wrapper (native fetch) over the REST API. Ships with TypeScript types.
Install¶
Works in Node 18+, Bun, and Deno. In the browser it uses the browser's fetch (but don't ship a secret sk_live_… key to browsers).
Configure¶
export SISTEMO_API_KEY=sk_live_xxxxxxxxxxxxxxxx
# optional — override the API endpoint:
export SISTEMO_BASE_URL=https://your-own-host:8000
Hello, sandbox¶
import { Sandbox } from "@sistemo/sdk";
const sb = await Sandbox.create(); // reads SISTEMO_API_KEY
const r = await sb.run("node -e 'console.log(2 + 2)'");
console.log(r.stdout, r.exitCode); // "4\n" 0
await sb.close();
run() waits until the command finishes (default 120 s, max 24 hours).
new Sandbox() does not work — the constructor is private
Creating a sandbox is asynchronous (it blocks until the microVM has booted), and a JavaScript constructor cannot await. Sandbox.create() is the only way in; new Sandbox({ apiKey }) throws a TypeError. The Python SDK spells it Sandbox() because Python can do the work in __init__ — if you are porting an example across, this is the line that changes.
What's here¶
Notes¶
The SDK sends a User-Agent header on every request (required — generic UAs are blocked by the cloud WAF). Pin a version in production: