Reconnect to an existing sandbox by ID.
This allows you to resume working with a sandbox that was created earlier with a duration-based lifetime.
fromId(
id: string,
options: Pick<DenoSandboxOptions, "auth" | "token" | "org" | "apiEndpoint">
): Promise<DenoSandbox>| Name | Type | Description |
|---|---|---|
id* | string | The ID of the sandbox to reconnect to |
options | Pick<DenoSandboxOptions, "auth" | "token" | "org" | "apiEndpoint"> | Optional auth configuration (for token) |
// Resume a sandbox from a stored ID
const sandbox = await DenoSandbox.fromId("sandbox-abc123");
const result = await sandbox.execute("ls -la");