Skip to main content

restoreSnapshot()v4.0.425

Restores a sandbox from a cached snapshot. Reads the snapshot ID from Vercel Blob storage (keyed by VERCEL_DEPLOYMENT_ID) and creates a sandbox from it.

This is the production counterpart to createSandbox(). Use createSandbox() during development and restoreSnapshot() in production.

Example

await using sandbox = process.env.VERCEL
  ? await restoreSnapshot()
  : await createSandbox({bundleDir: '.remotion'});

Arguments

None.

Return value

A VercelSandbox object restored from the cached snapshot. Throws if no snapshot is found.

See also