Automate your supabase media handling
Introduction
In this guide, you will:
- Upload media files to Supabase Storage.
- Trigger Ittybit automations from webhook functions or database triggers.
- Build automations for different media types (video, image, audio).
- Process files with descriptions, thumbnails, transcripts, and more.
- Automatically save processed files back to Supabase storage.
- Add generated metadata to your database.
Set up a complete media processing pipeline that automatically handles every file uploaded to your Supabase storage.
Step 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.
Upload Files via Dashboard
- Click into your
ittybit-filesbucket or the existing bucket - Click Upload files button
- Select files from your computer to upload
- Files will appear in the bucket list once uploaded
Get File Path
After upload, note the file path shown in the dashboard . You'll need this for triggering automations.
Step 2: Trigger ittybit automation from a webhook function
Create a serverless function that triggers your Ittybit automation when files are uploaded.
Supabase Edge Function Example:
Step 3: Optionally, put the trigger directly in a database function
For a more direct approach, use PostgreSQL triggers to automatically call Ittybit.
Database Trigger Function:
Step 4: Build automation with code or on ittybit
Create automations that handle different media types with appropriate processing.
Simple Version - Basic Media Processing:
Step 5: Use custom prompts for specialized processing
Leverage AI prompts to build custom functionality for your specific use cases.
Customer Service Call Analysis:
Content Moderation:
Step 6: Upload created files back to supabase storage and send webhooks
Configure your automation to save processed files back to Supabase and notify your application.
Enhanced Automation with Webhooks:
Step 7: Add extra file metadata to objects table
Extend your Supabase storage objects table to store Ittybit-generated metadata.
Create Metadata Table:
This complete pipeline automatically processes every file uploaded to Supabase Storage, generates rich metadata and derivatives, saves everything back to your storage, and updates your database, all without manual intervention.