Railway provider for ComputeSDK - simple cloud deployment for containerized sandboxes
npm install @computesdk/railwayRailway provider for ComputeSDK that enables creating and managing containerized sandboxes on Railway's infrastructure.
``bash`
npm install @computesdk/railway
The Railway provider requires the following environment variables:
`bash`
RAILWAY_API_KEY=your_railway_api_key
RAILWAY_PROJECT_ID=your_railway_project_id
RAILWAY_ENVIRONMENT_ID=your_railway_environment_id
Use the gateway for zero-config auto-detection:
`typescript
import { compute } from 'computesdk';
// Auto-detects Railway from RAILWAY_API_KEY/RAILWAY_PROJECT_ID/RAILWAY_ENVIRONMENT_ID environment variables
const sandbox = await compute.sandbox.create();
console.log(Created sandbox: ${sandbox.sandboxId});
await sandbox.destroy();
`
For direct SDK usage without the gateway:
`typescript
import { railway } from '@computesdk/railway';
const compute = railway({
apiKey: process.env.RAILWAY_API_KEY,
projectId: process.env.RAILWAY_PROJECT_ID,
environmentId: process.env.RAILWAY_ENVIRONMENT_ID
});
const sandbox = await compute.sandbox.create();
console.log(Created sandbox: ${sandbox.sandboxId});
await sandbox.destroy();
`
Docker image
- python - Uses python:alpine Docker image (default)$3
- apiKey - Railway API authentication token
- projectId - Railway project identifier
- environmentId - Railway environment identifierNotes
- Services are automatically deployed upon creation
- Service names are generated with timestamp:
sandbox-{timestamp}`