Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/content/docs/docs/providers/blaxel.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ interface BlaxelConfig {
region?: string;
/** Default memory allocation in MB (default: 4096) */
memory?: number;
/** Default ports for sandbox (default: [3000]) */
ports?: number[];
}
```

Expand Down
81 changes: 81 additions & 0 deletions src/content/docs/docs/providers/codesandbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
title: "Codesandbox"
description: ""
sidebar:
order: 2
---

Codesandbox provider for ComputeSDK - Execute code in Codesandbox development environments.

## Installation & Setup

```bash
npm install computesdk

# add to .env file
COMPUTESDK_API_KEY=your_computesdk_api_key

CSB_API_KEY=your_codesandbox_api_key
```


## Usage

### With ComputeSDK

```typescript
import { compute } from 'computesdk';
// auto-detects provider from environment variables

// Create sandbox
const sandbox = await compute.sandbox.create();

// Execute code
const result = await sandbox.runCode('print("Hello from Codesandbox!")');
console.log(result.stdout); // "Hello from Codesandbox!"

// Clean up
await compute.sandbox.destroy(sandbox.sandboxId);
```

### Configuration Options

```typescript
interface CodesandboxConfig {
/** CodeSandbox API key - if not provided, will fallback to CSB_API_KEY environment variable */
apiKey?: string;
/** Template to use for new sandboxes */
templateId?: string;
/** Execution timeout in milliseconds */
timeout?: number;
}
```


## Explicit Provider Configuration
If you prefer to set the provider explicitly, you can do so as follows:
```typescript
import { compute } from 'computesdk';

compute.setConfig({
computesdkApiKey: process.env.COMPUTESDK_API_KEY,
provider: 'codesandbox',
codesandbox: {
apiKey: process.env.CSB_API_KEY
}
});

const sandbox = await compute.sandbox.create();
```

## Runtime Detection

The provider automatically detects the runtime based on code patterns:

**Python indicators:**
- `print` statements
- `import` statements
- `def` function definitions
- Python-specific syntax (`f"`, `__`, etc.)

**Default:** Node.js for all other cases
2 changes: 1 addition & 1 deletion src/content/docs/docs/providers/daytona.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Daytona"
description: ""
sidebar:
order: 2
order: 3
---

Daytona provider for ComputeSDK - Execute code in Daytona development workspaces.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/providers/e2b.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "E2B"
description: ""
sidebar:
order: 3
order: 4
---

E2B provider for ComputeSDK
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/providers/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Modal"
description: ""
sidebar:
order: 4
order: 5
---

Modal provider for ComputeSDK - Execute code with GPU support for machine learning workloads.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/providers/namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Namespace"
description: ""
sidebar:
order: 5
order: 6
---

## Deploy sandboxes on Namespace with ComputeSDK
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/providers/railway.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Railway"
description: ""
sidebar:
order: 6
order: 7
---

## Deploy sandboxes on Railway with ComputeSDK
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/providers/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Render"
description: ""
sidebar:
order: 7
order: 8
---

## Deploy sandboxes on Render with ComputeSDK
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/providers/vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Vercel"
description: ""
sidebar:
order: 8
order: 9
---

Vercel provider for ComputeSDK - Execute code in globally distributed serverless environments.
Expand Down