Edge Function
An Edge Function is a small piece of server-side code that runs on demand on a serverless, geographically distributed runtime rather than in the browser. In the Supabase/Lovable stack, Edge Functions (Deno-based) are where you put trusted logic — handling webhooks, calling third-party APIs with secret keys, or running operations that need the service_role key safely away from the client.
Also known as: Supabase Edge Function · serverless function
Because the code runs on the server, an Edge Function is the correct place for anything that must not be exposed to the browser: payment webhooks, secret API keys, and privileged database writes. Putting that logic in client code instead is a frequent source of security holes in AI-built apps.
In the Lovable/Supabase stack, Edge Functions are also where the service_role key belongs so it never reaches the browser. Common mistake: calling a paid or secret third-party API directly from client code instead of routing it through an Edge Function — which leaks the key to anyone who opens the network tab and can run up real charges on your account.
Stuck on the thing this term describes? Talk to a senior engineer.
Book a free 30-minute audit call. We'll diagnose what's wrong and tell you exactly what it costs to fix.