managarten/apps/picture/scripts/set-replicate-key.sh
Wuesteon ff80aeec1f refactor: restructure
monorepo with apps/ and services/
  directories
2025-11-26 03:03:24 +01:00

30 lines
No EOL
814 B
Bash
Executable file

#!/bin/bash
# Script to set Replicate API Key in Supabase Edge Functions
echo "Setting Replicate API Key for Supabase Edge Functions..."
echo ""
echo "Please enter your Replicate API Key (starts with r8_):"
read -s REPLICATE_KEY
echo ""
if [[ ! $REPLICATE_KEY == r8_* ]]; then
echo "Error: API Key should start with 'r8_'"
exit 1
fi
echo "Setting the key in Supabase..."
# Set using Supabase CLI
npx supabase secrets set REPLICATE_API_KEY=$REPLICATE_KEY --project-ref mjuvnnjxwfwlmxjsgkqu
echo ""
echo "Waiting for secrets to sync (20 seconds)..."
sleep 20
echo ""
echo "Done! The key has been set. Please test the image generation now."
echo ""
echo "To verify, you can check in Supabase Dashboard:"
echo "1. Go to Edge Functions → Secrets"
echo "2. You should see REPLICATE_API_KEY listed there"