Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent

What are Supabase Edge Functions?

Last checked 31 Aug 2026

Short answer

Edge Functions are small serverless backend functions that run outside the browser — used for anything requiring a secret key, a third-party call, or logic that shouldn't be trusted to the client.

What they are

Edge Functions are serverless functions that form part of Lovable Cloud's built-in backend (the same underlying technology when you connect your own Supabase project). They run server-side, close to users, rather than in the visitor's browser.

Why your app needs them

Anything that must stay off the client — calling a paid API with a secret key, sending an email, processing a payment, running logic a user shouldn't be able to tamper with — belongs in an edge function. The front-end calls the function; the function does the sensitive work and returns a result.

What Lovable does for you

Ask Lovable to add a feature that needs this kind of logic, and it generates the edge function, wires up the secret it needs, and connects your front-end to call it. You can view invocation logs, success rates and errors for each function from the Cloud tab.

Add an edge function that calls the OpenWeather API with our stored API key and returns today's forecast for a given city

Typical uses

  • Calling third-party APIs that require a private key (Stripe, Resend, custom REST APIs).
  • Processing webhooks from external services.
  • Running validation or business logic that must not be bypassable from the browser.
  • Sending transactional email.

What usually goes wrong

  • Trying to call a paid third-party API directly from the front-end, exposing the key — this is exactly what edge functions exist to prevent.
  • Expecting an edge function to run instantly on every keystroke; they're for discrete actions, not continuous client-side state.
  • Not checking the function's logs when something fails silently — the Cloud tab's function logs are usually the fastest way to see the real error.

See also /questions/when-should-i-use-an-edge-function and /questions/how-do-i-safely-store-api-keys.

Sources

Was this answer helpful?

Related questions

Website made, maintained and hosted by PromptSites.com

PromptSites logo