createSandbox(options: CreateSandboxOptions): Promise<Sandbox>| Name | Type | Description |
|---|---|---|
options | CreateSandboxOptions | Creation options. Use |
const sandbox = await client.createSandbox();
// Or, resolve by snapshot name:
const sandbox = await client.createSandbox({
snapshotName: "python",
});
try {
const result = await sandbox.run("echo hello");
console.log(result.stdout);
} finally {
await sandbox.delete();
}Create a new Sandbox.
Remember to call sandbox.delete() when done to clean up resources.