Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 1.33 KB

File metadata and controls

75 lines (60 loc) · 1.33 KB
description Set up the Runloop provider for ComputeSDK, configure your API key, and create sandboxes to run commands.
layout
width title description tableOfContents outline pagination metadata tags actions
default
visible
true
visible
visible
true
visible
true
visible
true
visible
true
visible
true
visible
true
tags
tag primary
benchmarked
true

Runloop

{% embed url="https://www.computesdk.com/benchmarks/sandboxes/runloop/" %}

Runloop provider for ComputeSDK

Installation & Setup

npm install @computesdk/runloop

Add your Runloop credentials to a .env file:

RUNLOOP_API_KEY=your_runloop_api_key

Usage

import { runloop } from '@computesdk/runloop';

const compute = runloop({
  apiKey: process.env.RUNLOOP_API_KEY,
});

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

// Run a command
const result = await sandbox.runCommand('echo "Hello from Runloop!"');
console.log(result.stdout); // "Hello from Runloop!"

// Clean up
await sandbox.destroy();

Configuration Options

interface RunloopConfig {
  /** Runloop API key - if not provided, will use RUNLOOP_API_KEY env var */
  apiKey?: string;
  /** Execution timeout in milliseconds */
  timeout?: number;
}