# 🔐 Setup Mux Secrets in Supabase ## Your Credentials ``` MUX_TOKEN_ID: 3ceb1723-1274-48ed-bc1d-0ab967f2dda5 MUX_TOKEN_SECRET: kYuAFBuOEiA+XZD8qRfgv6rcLVTJWdOLUTrLhiYagVej8UCRdjSzxOAFpvFQJHePcDd/KhqFXcE ``` ## ⚡ Quick Setup (2 minutes) ### Step 1: Open Supabase Dashboard Go to: https://supabase.com/dashboard/project/ytoadlpbdguriiccjnip/settings/functions ### Step 2: Add Secrets Look for **"Secrets"** or **"Environment Variables"** section. Click **"New secret"** or **"Add secret"** and add: **First Secret:** - Name: `MUX_TOKEN_ID` - Value: `3ceb1723-1274-48ed-bc1d-0ab967f2dda5` **Second Secret:** - Name: `MUX_TOKEN_SECRET` - Value: `kYuAFBuOEiA+XZD8qRfgv6rcLVTJWdOLUTrLhiYagVej8UCRdjSzxOAFpvFQJHePcDd/KhqFXcE` ### Step 3: Save & Verify 1. Click **Save** or **Add** 2. You should see both secrets listed (values will be hidden) ### Step 4: Redeploy Function (if needed) If the function still doesn't work after adding secrets: 1. Go to: https://supabase.com/dashboard/project/ytoadlpbdguriiccjnip/functions 2. Find **mux-proxy** in the list 3. Click the **⋮** menu (three dots) 4. Select **"Redeploy"** or **"Deploy new version"** ## ✅ Test It 1. Go to http://localhost:5173/playground/video-player 2. Sign in 3. Try uploading a video 4. Should work now! 🎉 ## 🔍 Troubleshooting ### Still getting "Mux credentials not configured"? **Check #1: Are secrets set?** - Dashboard → Settings → Functions → Secrets - You should see `MUX_TOKEN_ID` and `MUX_TOKEN_SECRET` listed **Check #2: Is function deployed?** - Dashboard → Edge Functions - `mux-proxy` should show as "Active" or "Deployed" **Check #3: Redeploy** - Sometimes secrets don't update until you redeploy - Click the ⋮ menu next to mux-proxy → Redeploy **Check #4: Browser console** - Open DevTools (F12) - Look for detailed error messages ### Different error? Check the browser console and edge function logs: - Dashboard → Edge Functions → mux-proxy → Logs ## 📝 Notes - **Local .env file**: Only used for local development, NOT for edge functions - **Edge function secrets**: Must be set in Supabase Dashboard - **Security**: Secrets are encrypted and never exposed to the client - **Updates**: If you change secrets, redeploy the function ## 🎯 Quick Links - Mux Dashboard: https://dashboard.mux.com - Supabase Project: https://supabase.com/dashboard/project/ytoadlpbdguriiccjnip - Edge Functions: https://supabase.com/dashboard/project/ytoadlpbdguriiccjnip/functions - Function Settings: https://supabase.com/dashboard/project/ytoadlpbdguriiccjnip/settings/functions