| description |
Set up the Sprites provider for ComputeSDK, configure your token, and create cloud sandboxes to run commands and expose apps. |
| layout |
| width |
title |
description |
tableOfContents |
outline |
pagination |
metadata |
tags |
actions |
default |
|
|
|
|
|
|
|
|
|
Sprites provider for ComputeSDK - cloud sandboxes powered by Sprites
npm install @computesdk/sprites
Add your Sprites credentials to a .env file:
SPRITES_TOKEN=your_sprites_token
import { sprites } from '@computesdk/sprites';
const compute = sprites({
apiKey: process.env.SPRITES_TOKEN,
});
// Create sandbox
const sandbox = await compute.sandbox.create();
// Run a command
const result = await sandbox.runCommand('echo "Hello from Sprites!"');
console.log(result.stdout); // "Hello from Sprites!"
// Clean up
await sandbox.destroy();
interface SpritesConfig {
/** Sprites API token - if not provided, will fallback to SPRITES_TOKEN environment variable */
apiKey?: string;
/** Base URL for the Sprites API - defaults to https://api.sprites.dev/v1 */
baseUrl?: string;
/** Execution timeout in milliseconds */
timeout?: number;
}
| Method |
Supported |
Notes |
create |
✅ |
Provisions a new Sprite via POST /sprites. |
getById |
✅ |
Looks up a Sprite by name. |
list |
✅ |
Lists all Sprites for the token. |
destroy |
✅ |
Deletes the Sprite. |
runCommand |
✅ |
Executes commands over the bash exec endpoint; supports cwd/env. |
getInfo |
✅ |
|
getUrl |
✅ |
Returns the Sprite's public URL (Sprites are created with public auth). |
filesystem |
✅ |
Native read, write, mkdir, readdir, exists, remove. |