Adapters

What an adapter is, how to swap backends, and which one to use.

An adapter implements the RenderAdapter interface and handles the actual execution of a render. Pass one adapter to RenderSdk at construction; swap it to change execution targets without touching the rest of your code.

Comparison

RenderServerRenderLambda
peer dependency@remotion/renderer@remotion/lambda
concurrencylocal p-limit (default 2)AWS Lambda auto-scaling
state persistenceStateStore (default InMemoryStore())stateless handle encoding
output storagelocal disk (workDir)S3
getUrl() returns${publicUrl}/${handle}.${ext}S3 outputFile URL
getUrl() valid whenfile exists on disk (after done)status === "done" only
download()reads from diskfetches the S3 URL
provisioningrun bundle() at startuprun deploySite + deployFunction in CI
suitable forlocal dev, small teams, single-serverhigh-volume, burst workloads, serverless

RenderAdapter interface

If you want to write a custom adapter, implement:

interface RenderAdapter<O = unknown> {
  start(input: RenderInput, options?: O): Promise<RenderHandle>;
  getState(handle: RenderHandle): Promise<RenderState>;
  getUrl(handle: RenderHandle): Promise<string>;
  download(handle: RenderHandle): Promise<ReadableStream>;
}

Pass the adapter to new RenderSdk({ adapter }) and the OptionsOf<typeof adapter> type will be inferred automatically for sdk.start().

On this page