fromId(sandboxId: string, options: Pick<ModalSandboxOptions, "auth">): Promise<ModalSandbox| Name | Type | Description |
|---|---|---|
sandboxId* | string | |
options | Pick<ModalSandboxOptions, "auth"> |
Reconnect to an existing sandbox by ID.
This allows you to resume working with a sandbox that was created earlier and is still running.
The ID of the sandbox to reconnect to
Optional auth configuration
// Resume a sandbox from a stored ID
const sandbox = await ModalSandbox.fromId("sb-abc123");
const result = await sandbox.execute("ls -la");