A small piece of server-side code that runs close to the user, handling tasks like sending emails or processing payments.
An Edge Function is a piece of server-side code that runs on demand, close to the user, without managing a Server. Supabase Edge Functions use TypeScript and run on the Deno runtime (similar to Node.js).
Edge Functions handle API logic, process webhooks, validate authentication, interact with databases via SQL or REST APIs, and return JSON responses with appropriate status codes. They can run Middleware logic, connect to Docker services, and manage API keys through environment variables.
When an Edge Function fails, errors appear in the Supabase server logs — not in your browser console. Use structured logging with console.log() prefixes inside your function to leave breadcrumbs. CORS headers must be included in every response, or your Frontend will get blocked. The Network Tab in DevTools shows the request and Status Code returned by the function. Error Handling with Try/Catch ensures the function returns a proper error JSON response instead of crashing silently.
Edge Functions are the modern replacement for traditional servers. They scale automatically, cost nothing when idle, and deploy globally via CLI commands. Claude Code can write, test, and deploy Edge Functions. Each function has its own Endpoint and runs in an isolated container.
Edge Functions must include CORS headers in every HTTP Response, or the browser will block the response. In Production, errors appear in Supabase logs, not the browser console.
We give you the skills to build, deploy, and own a full product. Professional stack, AI co-pilot, no coding background required.