Convert and compress every Supabase video
In this guide, you will:
- Upload a video to Supabase Storage
- Trigger an automation on ittybit using a POST request
- Use the signed URL from Supabase Storage in the request
- Create an automation in code for video processing
- Handle webhooks to download processed files to storage
- Display processed videos using the HTML
<video>
element
1. Upload to Supabase Storage
Ensure you have already created a Storage bucket in your Supabase project. If you haven't, you can follow the Supabase guide on creating buckets.
First, upload a file to your Storage bucket. This will generate a signed URL needed for the next step.
2. Trigger an automation on ittybit (via POST request)
Send a POST request to create a video compression task using the fetch
API:
3. Create an automation in code for video processing
You can build automations visually in the ittybit dashboard or programmatically. This code creates a video automation that:
- Converts videos to MP4 format with 75% quality compression
- Optionally generates subtitles, thumbnails, and chapters
- Processes files automatically when triggered
Save the returned automation_id
and use it in your POST request from Step 2 instead of specifying individual task parameters.
4. Handle webhooks to download processed files to storage
When ittybit processes your video, it sends webhooks for each created file. Handle these to save files to Supabase Storage and update your database:
5. Render video using the HTML <video>
element
Display your processed video with all generated features:
Use the thumbnails for preview images or custom video players.
Optional: Use an S3 connection
Instead of handling file downloads manually, connect Supabase Storage to ittybit as S3‑compatible storage. This eliminates the need for webhook file downloads.
Replace signed URL with connection
Update your POST request to use the S3 connection instead of a signed URL:
Update automation with S3 uploads
Modify your automation to save processed files directly back to your storage:
Now processed files are automatically saved to your Supabase Storage, removing the need for manual download steps in your webhook.