Using Remotion Lambda with Supabase
This page shows how to trigger a Remotion Lambda render from a Supabase Edge Function.
Other than that, the steps to use Remotion Lambda are the same as described in the Remotion Lambda setup.
Invoking a Remotion Lambda render from Supabase Edge Functionsv4.0.265
Install the @remotion/lambda-client package in your Supabase Edge Functions project:
bash
Replace 4.0.265 with the version of Remotion you are using.
Set the environment variable AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY:
supabase/functions/.envbash
supabase/functions/trigger-render.tstsx
Make sure to resolve the three FIXME comments.
Storing your renders in Supabase Storagev4.0.259
Create a Supabase Storage bucket and set the environment variables SUPABASE_ACCESS_KEY_ID, SUPABASE_SECRET_ACCESS_KEY.
Use an s3OutputProvider to store the rendered video in Supabase Storage:
tsxbucketName ,renderId ,cloudWatchMainLogs } = awaitrenderMediaOnLambda ({serveUrl : 'https://remotion-helloworld.vercel.app',// FIXME: Add your function specs herefunctionName :speculateFunctionName ({diskSizeInMb : 2048,memorySizeInMb : 2048,timeoutInSeconds : 120,}),composition : 'HelloWorld',// FIXME: Replace with your AWS regionregion : 'eu-central-1',codec : 'h264',outName : {// FIXME: Use the bucket name from your Supabase Storage settingsbucketName : 'remotion-test-bucket',key : 'out.mp4',s3OutputProvider : {// FIXME: Use the endpoint from your Supabase Storage settingsendpoint : 'https://kudbuxgvpedqabsivqjz.supabase.co/storage/v1/s3',// FIXME: Use the Access Key from your Supabase Storage settingsaccessKeyId :process .env .SUPABASE_ACCESS_KEY_ID ?? '',// FIXME: Use the Secret Access Key from your Supabase Storage settingssecretAccessKey :process .env .SUPABASE_SECRET_ACCESS_KEY ?? '',// FIXME: Use the region from your Supabase Storage settingsregion : 'eu-central-1',forcePathStyle : true,},},});