Skip to content

Instantly share code, notes, and snippets.

@vqc1909a
Created November 6, 2025 21:27
Show Gist options
  • Select an option

  • Save vqc1909a/1a03300ea072abdbce8956a303378751 to your computer and use it in GitHub Desktop.

Select an option

Save vqc1909a/1a03300ea072abdbce8956a303378751 to your computer and use it in GitHub Desktop.
SCRIPT_DOWNLOAD_ALL_EDGE_FUNCTIONS
#!/bin/bash
# Download ALL edge functions from Supabase cloud
echo "πŸš€ Starting comprehensive edge functions download..."
# Extract function names from the list (all of them!)
functions=(
"meta-auth"
"snapchat-refresh"
"snapchat-accounts"
"meta-accounts"
"tiktok-auth"
"tiktok-accounts"
"upload-facebook-creative"
"upload-tiktok-video"
"upload-snapchat-video"
"meta-insights"
"snapchat-insights"
"tiktok-insights"
"campaign-insights"
"audience-insights"
"ad-insights"
"snapchat-ad-details"
"create-campaign"
"summarize-video"
"get-campaign-platforms"
"get-pixels"
"known-audiences"
"maps-locations-search"
"zip-search"
"get-schema"
"get-temporary-exclusions"
"generate-video-ideas"
"generate-voice"
"accept-faniq-audiences"
"get-active-audiences"
"tiktok-identities"
"tiktok-create-identity"
"facebook-generate-preview"
"test-payload"
"snapchat-generate-preview"
"facebook-create-creative"
"snapchat-create-creative"
"tiktok-create-creative"
"tixr-proxy"
"meta-create-ad"
"upload-tiktok-media"
"deploy-ads"
"deploy-meta-ads"
"deploy-snapchat-ads"
"deploy-tiktok-ads"
"process-audience-payload"
"snapchat-create-ad"
"tiktok-create-ad"
"audience-ad-insights"
"search-meta-interests"
"snapchat-interest-search"
"clever-responder"
"tiktok-interest-search"
"facebook-campaign-details"
"update-facebook-campaign"
"meta-identities"
"accept-faniq_audience"
"facebook-insights-report"
"super-task"
"create_dataset_bigquery"
"facebook_bigquery_backfill"
"instagram_bigquery_backfill"
"snapchat_bigquery_backfill"
"get-external-campaigns"
"tiktok-audience-size"
"snapchat-campaign-details"
"update-snapchat-campaign"
"tiktok-campaign-details"
"tiktok-update-campaign"
"get-ad-details"
"get-snapchat-ad-details"
"get-tiktok-ad-details"
"update-ad-status"
"facebook-adset-details"
"ai-campaign-assistant"
"ai-campaign-assistant-mcp"
"account-mappings-insights"
"snapchat-refresh-all"
"campaign-tree-insights"
"cron-sync-trigger"
"scheduled-data-sync"
"tixr-public-feed"
"transform-video-webhook"
"sync-audience-to-platforms"
"fetch-audience-sizes"
"snapchat-adset-details"
"tiktok-adset-details"
"get-all-platform-campaigns"
"creatomate-render"
"spotify-search"
"spotify-track-details"
"create-meta-audience"
"pexels-proxy"
"perplexity-sports-search"
"etix-proxy"
"facebook-data-deletion"
"campaign-tree-data"
"instagram-media-proxy"
"duplicate-meta-campaign"
"create-unified-campaign"
"spotify-artist-audience"
"perplexity-artist-audience"
"fetch-youtube-artist-content"
"fetch-stock-media"
"parse-fevo-event"
"event-form-management"
"get-upcoming-campaigns"
"get-meta-campaigns"
"get-snapchat-campaigns"
"get-tiktok-campaigns"
"perplexity-event-audience"
"team-invite"
"firecrawl-scrape"
"ai-campaign-extractor"
"perplexity-url-audience"
"upload-image-from-url"
"download-image"
"google-ads-auth"
"google-ads-callback"
"google-ads-refresh"
"google-ads-client-accounts"
"instagram-scraper-cron"
"fetch-all-events"
"send-team-invitation"
"accept-team-invitation-complete"
"generate-team-invite-code"
"join-team-with-code"
"create-team"
"get-user-teams"
"get-accessible-account-mappings"
"update-adset-status"
"get-ad-permalink"
"get-meta-campaign-hierarchy"
"get-user-teams-safe"
"get-team-access-context"
"tiktok_bigquery_backfill"
"instagram-scrape"
"get-optimize-share-links"
"create-optimize-share-link"
"validate-optimize-share-link"
"delete-optimize-share-link"
"validate-share-link-v2"
"backfill-orchestrator"
"hourly-backfill-trigger"
"create-admin-views"
"create-master-all-platforms-view"
"create-master-view"
"create-master-view-simple"
"create-master-view-validated"
"scan-datasets"
"scan-all-datasets"
"create-master-view-final"
"reset-all-datasets"
"six-month-backfill"
"create-master-view-unified"
"refresh-master-view"
"scheduled-refresh"
"get-campaign-tree-data"
"test-bigquery-simple"
"quick-refresh-all-clients"
"create-all-clients-table"
"sync-bigquery-to-supabase"
"sync-bigquery-365"
"replace-campaign-data"
"cleanup-all-tiktok"
"create-sub-account"
"get-sub-accounts"
"update-sub-account-permissions"
"create-sub-account-invite"
"accept-sub-account-invitation"
"team-sub-account-login"
"create-team-sub-account"
"create-team-user"
"team-login"
"axs-proxy"
"axs"
"sync-all-events"
"event-sync-cron"
"setup-database"
"sync-events-to-database"
"scheduled-events-sync"
"force-sync-now"
"canadian-postal-codes"
"get-campaign-insights"
"unified-ads-backfill"
"scheduled-backfill-rotator"
"campaign-insights-ai"
"duplicate-enhanced-campaign"
"update-facebook-ad"
"create-shared-optimize-link"
"validate-shared-optimize-link"
"manage-shared-optimize-links"
"slack-login-notify"
"admin-user-search"
"admin-impersonate-query"
"get-pixels-by-mapping"
"list-edge-functions"
"get-edge-function-body"
"get-function-source-code"
"internal-meta-create-ad"
"faniq-campaign-insights-detailed"
"faniq-campaign-insights"
"get-meta-insights"
"save-campaign-draft"
"load-campaign-draft"
"list-campaign-drafts"
"delete-campaign-draft"
"save-campaign-payload"
"load-campaign-payload"
"list-campaign-payloads"
"delete-campaign-payload"
"meta-refresh"
"get-meta-account-info"
"scheduled-bigquery-view-refresh"
"google-ads-accounts"
)
# Counter for tracking progress
total=${#functions[@]}
current=0
success=0
failed=0
echo "πŸ“Š Total functions to download: $total"
echo "πŸ”„ Starting download process..."
echo
# Download functions one by one with error handling and progress tracking
for func in "${functions[@]}"; do
current=$((current + 1))
echo "[$current/$total] πŸ“₯ Downloading: $func"
if npx supabase functions download "$func" 2>/dev/null; then
success=$((success + 1))
echo " βœ… Success: $func"
else
failed=$((failed + 1))
echo " ❌ Failed: $func"
# Retry once after a short delay
echo " πŸ”„ Retrying: $func"
sleep 2
if npx supabase functions download "$func" 2>/dev/null; then
success=$((success + 1))
failed=$((failed - 1))
echo " βœ… Retry Success: $func"
else
echo " ❌ Retry Failed: $func"
fi
fi
# Small delay to avoid rate limiting
sleep 0.3
done
echo
echo "πŸŽ‰ Download Summary:"
echo " πŸ“ˆ Total functions: $total"
echo " βœ… Successfully downloaded: $success"
echo " ❌ Failed downloads: $failed"
echo " πŸ“Š Success rate: $((success * 100 / total))%"
echo
if [ $success -gt 0 ]; then
echo "πŸš€ Functions are now available in supabase/functions/"
echo "πŸ’‘ To deploy them locally, run:"
echo " npx supabase functions deploy --no-verify-jwt"
fi
echo
echo "✨ Edge functions download completed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment