Connect to an existing sandbox by ID.
This allows you to resume working with a sandbox that was created earlier or that is still running.
fromId(
id: string,
options: Pick<DaytonaSandboxOptions, "auth" | "target" | "timeout">
): Promise<DaytonaSandbox>| Name | Type | Description |
|---|---|---|
id* | string | |
options | Pick<DaytonaSandboxOptions, "auth" | "target" | "timeout"> | Optional auth configuration (for API key) |
// Resume a sandbox from a stored ID
const sandbox = await DaytonaSandbox.connect("sandbox-abc123");
const result = await sandbox.execute("ls -la");