Skip to content

Latest commit

 

History

History
96 lines (76 loc) · 2.16 KB

File metadata and controls

96 lines (76 loc) · 2.16 KB
description NeevCloud provider for ComputeSDK - run commands and manage files in secure cloud sandboxes with preview URLs.
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

NeevCloud

NeevCloud provider for ComputeSDK - run commands and manage files in secure cloud sandboxes.

Installation & Setup

npm install @computesdk/neevcloud

Add your NeevCloud credentials to a .env file:

NEEV_API_KEY=your_neev_api_key
NEEV_ORG_ID=your_neev_org_id
NEEV_PROJECT_ID=your_neev_project_id

Usage

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

const compute = neevcloud({
  apiKey: process.env.NEEV_API_KEY,
  orgId: process.env.NEEV_ORG_ID,
  projectId: process.env.NEEV_PROJECT_ID,
});

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

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

// Clean up
await sandbox.destroy();

Configuration Options

interface NeevCloudConfig {
  /** NeevCloud API key - if not provided, will use NEEV_API_KEY env var */
  apiKey?: string;
  /** Org the sandboxes belong to - if not provided, will use NEEV_ORG_ID env var */
  orgId?: string;
  /** Project the sandboxes belong to - if not provided, will use NEEV_PROJECT_ID env var */
  projectId?: string;
  /** Request timeout in milliseconds */
  timeout?: number;
}

Preview URLs

Expose any port over a public HTTPS URL:

await sandbox.runCommand('python3 -m http.server 3000', { background: true });
const url = await sandbox.getUrl({ port: 3000 });

Boot Source

Start from a catalogue template, a raw OCI image, or the platform default (templateId and image are mutually exclusive):

await compute.sandbox.create({ templateId: 'sb-ubuntu-24-04-minimal' });
await compute.sandbox.create({ image: 'docker.io/library/python:3.12' });