packages/docs/docs/vercel/get-render-progress.mdx
:::warning Experimental package: We reserve the right to make breaking changes in order to correct bad design decisions until this notice is gone. :::
Polls the progress of a detached renderMediaOnVercel() call.
Use this API when your Vercel function should start a render and return before the video has finished rendering.
import {getRenderProgress} from '@remotion/vercel';
export async function GET(req: Request) {
const url = new URL(req.url);
const sandboxId = url.searchParams.get('sandboxId');
const cmdId = url.searchParams.get('cmdId');
if (!sandboxId || !cmdId) {
return Response.json({error: 'Missing params'}, {status: 400});
}
const progress = await getRenderProgress({sandboxId, cmdId});
return Response.json(progress);
}
An object with the following properties:
sandboxIdThe ID returned from renderMediaOnVercel({detached: true}).
cmdIdThe command ID returned from renderMediaOnVercel({detached: true}).
A <TsType type="RenderProgress" source="@remotion/vercel" href="/docs/vercel/types#renderprogress" /> object.
Terminal stages are:
done: The render was uploaded to Vercel Blob.error: The render failed.expired: The sandbox no longer exists.When done or error is returned, remove the stored render handle in your app.
The sandbox is left alive until its configured timeout so a refreshed page can still read the terminal progress.