Create a new Sandbox.
Remember to call sandbox.delete() when done to clean up resources.
createSandbox(templateName: string, options: CreateSandboxOptions = {}): Promise<Sandbox>| Name | Type | Description |
|---|---|---|
templateName* | string | Name of the SandboxTemplate to use. |
options | CreateSandboxOptions | Default: {}Creation options. |
const sandbox = await client.createSandbox("python-sandbox");
try {
const result = await sandbox.run("echo hello");
console.log(result.stdout);
} finally {
await sandbox.delete();
}