Skip to main content

createSandbox()v4.0.425

Creates a new Vercel Sandbox with all Remotion dependencies installed, including system libraries, the compositor, a browser, and your Remotion bundle.

Creates a sandbox from scratch. In production, prefer restoreSnapshot() to restore from a cached snapshot instead.

Example

const sandbox = await createSandbox({
  bundleDir: '.remotion',
  onProgress: ({progress, message}) => {
    console.log(`${message} (${Math.round(progress * 100)}%)`);
  },
});

Arguments

An object with the following properties:

bundleDir

The path to your Remotion bundle directory, relative to the current working directory. This is the output of npx remotion bundle.

onProgress?

A callback that receives progress updates during sandbox creation.

import type {CreateSandboxOnProgress} from '@remotion/vercel';
type CreateSandboxOnProgress = (update: {
  progress: number; // 0 to 1
  message: string; // Human-readable phase description
}) => void;

Return value

A VercelSandbox object (a Sandbox with AsyncDisposable support). You can use await using to automatically clean up the sandbox when it goes out of scope.

See also