Benchmarked
Beam
Last updated
Was this helpful?
Was this helpful?
npm install @computesdk/beamBEAM_TOKEN=your_beam_token
BEAM_WORKSPACE_ID=your_beam_workspace_idimport { beam } from '@computesdk/beam';
const compute = beam({
token: process.env.BEAM_TOKEN,
workspaceId: process.env.BEAM_WORKSPACE_ID,
});
// Create sandbox
const sandbox = await compute.sandbox.create();
// Run a command
const result = await sandbox.runCommand('echo "Hello from Beam!"');
console.log(result.stdout); // "Hello from Beam!"
// Clean up
await sandbox.destroy();interface BeamConfig {
/** Beam API token - if not provided, will use BEAM_TOKEN env var */
token?: string;
/** Beam workspace ID - if not provided, will use BEAM_WORKSPACE_ID env var */
workspaceId?: string;
/** Gateway URL for custom/staging environments */
gatewayUrl?: string;
/** Request timeout in milliseconds */
timeout?: number;
}