getOrCreateSandbox()v4.0.425
The primary entry point for getting a sandbox. Automatically handles the dev/prod routing:
- Development (no
VERCELenv var): Creates a fresh sandbox from scratch usingcreateSandbox(). - Production (on Vercel): Restores a sandbox from a cached snapshot. Throws an error if no snapshot is found.
Example
await using sandbox = await getOrCreateSandbox ({
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.
onProgress?
A callback that receives progress updates. Only called during development when a fresh sandbox is created.
Return value
A VercelSandbox object.