Overview
Supabase Edge Functions are serverless functions that run close to your users. They’re used for:- Webhook handlers
- Background processing
- API endpoints that need server-side logic
https://ymdccxqzmhxgbjbppywf.supabase.co/functions/v1
Authentication
Edge Functions can be called with:- Anon Key (public, RLS enforced)
- Service Role Key (admin, bypasses RLS)
Available Functions
shopify-webhook
Handles Shopify webhooks for order and product sync. Endpoint:POST /functions/v1/shopify-webhook
Headers:
orders/createorders/updatedproducts/createproducts/updateproducts/delete
scrape-instagram
Triggers Instagram scraping for a specific source. Endpoint:POST /functions/v1/scrape-instagram
Body:
generate-article
Generates an article from scraped content. Endpoint:POST /functions/v1/generate-article
Body:
sync-viator
Syncs Viator affiliate products for a destination. Endpoint:POST /functions/v1/sync-viator
Body:
Creating New Functions
1. Create Function
2. Write Handler
3. Deploy
Environment Variables
Set secrets for functions:Local Development
Logs
View function logs:Best Practices
Error Handling
CORS
Database Access
Pricing
Edge Functions are billed by:- Invocations: First 500K/month free
- Execution time: First 500K GB-seconds free