Skip to content

Installation

The Runra JavaScript/TypeScript SDK is available via npm:

Terminal window
npm install runra

Or with Bun:

Terminal window
bun add runra

Set these environment variables to configure the SDK:

VariableRequiredDescription
RUNRA_API_KEYYesYour Runra API key
RUNRA_API_URLNoAPI base URL (defaults to https://box.runra.dev)
RUNRA_TEMPLATE_IDNoDefault sandbox template

You can also configure the SDK programmatically:

import { configure, Sandbox } from "runra";
configure({
apiKey: process.env.RUNRA_API_KEY,
// Optional: override API URL
apiUrl: "https://box.runra.dev",
// Optional: default template
template: process.env.RUNRA_TEMPLATE_ID,
});
const sandbox = await Sandbox.create();

The Runra SDK supports multiple sandbox providers:

ProviderDescription
runra-sandboxHosted Runra Sandbox (recommended)
cubesandboxSelf-hosted CubeSandbox
dockerLocal Docker
e2bE2B Code Interpreter

The SDK is written in TypeScript and includes full type definitions. No additional packages needed.

import { Sandbox } from "runra";

The SDK is backed by the E2B code-interpreter client, so the returned sandbox exposes E2B-compatible methods such as runCode(), commands.run(), files.write(), and files.read().