Media Workflow Quickstart
Fast-track guide for daily media operations with Supabase Storage + Keystatic CMS.
🎯 The Two-Step Process
Step 1: Upload to Supabase Storage
Step 2: Reference in Keystatic CMS
🏗️ Your Business Buckets
| Bucket | When to Use | Examples |
|---|---|---|
media_library | General content | Blog images, page assets, icons |
website_media | Visual branding | Product photos, logos, team photos |
marketing_media | Shareable content | PDFs, brochures, slide decks, videos |
demonstration_media | Product demos | Demo videos, tutorials, screenshots |
legal_documents | Legal content | Terms, privacy policies, contracts |
🚀 Method 1: Supabase Console (Easiest)
For Content Creators & Non-Technical Users
Upload Files:
- Go to Supabase Dashboard →
ld_websiteproject - Navigate to Storage → Buckets
- Choose appropriate bucket (see table above)
- Click "Upload files"
- Drag/drop or select your files
- Upload to organized folder (e.g.,
logos/,products/,brochures/)
Get URL:
- Click on uploaded file
- Copy the Public URL
- Example:
https://mgyzvwmmbtmtllliixue.supabase.co/storage/v1/object/public/website_media/logos/logo-primary.svg
Add to Keystatic:
- Go to
/keystatic→ Media Library → Create entry - Title: Descriptive name (e.g., "Primary Logo - White Background")
- Supabase Storage URL: Paste the URL from step above
- Category: Select matching bucket
- Alt Text: Describe for accessibility
- Status: Published
- Save entry
Use in Content:
- Edit any page/post in Keystatic
- In media fields, select from Media Library dropdown
- Choose your uploaded asset
- Save and publish
⚡ Method 2: CLI Upload (For Developers)
Bulk Operations & Automation
Single File Upload:
# Navigate to project cd apps/web # Upload with auto-optimization node scripts/bulk-media-upload.mjs \ --bucket=website_media \ --folder=./local-assets \ --destination=products/ \ --validate=true
Bulk Directory Upload:
# Upload entire folder with filtering node scripts/bulk-media-upload.mjs \ --bucket=marketing_media \ --folder=./marketing-assets \ --destination=brochures/ \ --filter=pdf,png,jpg \ --max-size=25 # The tool outputs Supabase URLs for each file
Quick List & Stats:
# List files in bucket pnpm media:list --bucket=website_media # Check storage usage pnpm media:stats --bucket=marketing_media # Validate organization pnpm media:validate --bucket=demonstration_media
📂 Folder Organization Guide
Recommended Structure:
# Website Media (logos, branding, product photos) website_media/ ├── logos/ # Company logos (svg, png) ├── products/ # Product photography ├── team/ # Team headshots └── branding/ # Brand guidelines, assets # Marketing Media (downloadable content) marketing_media/ ├── brochures/ # PDF marketing materials ├── presentations/ # Slide decks (pptx, pdf) ├── videos/ # Marketing videos └── social/ # Social media graphics # Demo Media (product demonstrations) demonstration_media/ ├── videos/ # Product demo videos ├── tutorials/ # How-to content ├── screenshots/ # Product screenshots └── use-cases/ # Customer examples # General Content (blog, pages) media_library/ ├── blog/ # Blog post images ├── pages/ # Page-specific assets └── uploads/ # General uploads
🔄 Common Workflows
Adding Product Images:
- Upload: Console →
website_mediabucket →products/folder - URL: Copy public URL from uploaded file
- Keystatic: Media Library → New → Paste URL → Category: "Website Media"
- Use: Product pages → Select from Media Library dropdown
Marketing Materials:
- Upload: Console →
marketing_mediabucket →brochures/folder - URL: Copy public URL (will be used for downloads)
- Keystatic: Media Library → New → Paste URL → Category: "Marketing Media"
- Use: Marketing pages → Link to downloadable assets
Blog Content:
- Upload: Console →
media_librarybucket →blog/folder - URL: Copy public URL
- Keystatic: Media Library → New → Paste URL → Category: "Media Library"
- Use: Blog posts → Featured image or inline content
✅ Quality Checklist
Before Upload:
- [ ] Optimize file sizes (< 2MB for images, < 25MB for videos)
- [ ] Use descriptive filenames (no spaces, use hyphens)
- [ ] Choose correct bucket for content type
- [ ] Organize in appropriate folder
In Keystatic Media Library:
- [ ] Descriptive title (not just filename)
- [ ] Accurate category matching the bucket
- [ ] Alt text for images (accessibility)
- [ ] Tags for organization (optional but helpful)
- [ ] Status set to Published
After Publishing:
- [ ] Test URL accessibility (open in browser)
- [ ] Verify in content (check page/post displays correctly)
- [ ] Mobile-friendly (responsive display)
🚨 Quick Troubleshooting
File Won't Upload:
- ✅ Check file size (see bucket limits above)
- ✅ Verify file format is supported
- ✅ Try smaller file first
- ✅ Refresh browser and retry
URL Not Working:
- ✅ Ensure bucket is public (all current buckets are)
- ✅ Copy exact URL from Supabase console
- ✅ Check for typos in URL
- ✅ Test URL directly in browser
Media Not Showing in Keystatic:
- ✅ Verify Media Library entry was saved
- ✅ Check that status is "Published"
- ✅ Refresh Keystatic admin interface
- ✅ Ensure URL field is populated
Need Help:
- 📖 Full Technical Guide: See Media Management Guide
- 🛠️ CLI Tools: Run
pnpm media:helpfor commands - 🔍 Debug: Run
node scripts/debug-env.mjsfor diagnostics
🎯 Examples by Use Case
Content Creator Adding Blog Image:
- Supabase Console →
media_library→ Upload toblog/ - Copy URL:
https://project.supabase.co/storage/v1/object/public/media_library/blog/article-hero.jpg - Keystatic → Media Library → New entry → Paste URL
- Blog Post → Featured Image → Select from dropdown
Marketing Team Adding Brochure:
- Supabase Console →
marketing_media→ Upload tobrochures/ - Copy URL:
https://project.supabase.co/storage/v1/object/public/marketing_media/brochures/product-catalog-2024.pdf - Keystatic → Media Library → New entry → Paste URL
- Marketing Page → Download Link → Select from dropdown
Developer Bulk Upload:
# Upload product photos node scripts/bulk-media-upload.mjs \ --bucket=website_media \ --folder=./product-photos \ --destination=products/tactical-gear/ \ --filter=jpg,png,webp # URLs automatically output for Keystatic entry creation
This quickstart covers 90% of daily media operations. For advanced scenarios, refer to the complete technical guide.