API Reference
Snapshots
Use normalized snapshot operations without hiding provider lifecycle differences.
Creating a snapshot
Check support before creating one.
import { supports } from "@opencoredev/sandbox-sdk";
if (supports(sandbox, "snapshot.create")) {
const snapshot = await sandbox.snapshots.create({
name: "configured-workspace",
});
}Snapshots report id, optional name, mode, and optional createdAt.
Deleting a snapshot
await sandbox.snapshots.delete(snapshot);
// An ID is also accepted:
await sandbox.snapshots.delete(snapshot.id);Restoring a snapshot
if (supports(sandbox, "snapshot.restore")) {
await sandbox.snapshots.restore(snapshot);
}Only Local exposes normalized in-place restore. E2B and Vercel restore flows create new native sandboxes, so those operations remain on sandbox.raw. Daytona snapshot and fork behavior also remains provider-specific.
Read next
Check exact modes in Compatibility.