Skip to main content
Edge functions run your app’s custom backend code: the work that can’t happen in the user’s browser, such as talking to other services, processing payments, or sending emails. Think of them as small programs that run on Lovable’s servers whenever your app needs them. There are no servers for you to set up, and they scale automatically with traffic. New Lovable apps created from May 13, 2026, which use TanStack Start, often run their server code inside the app instead. See Where your app’s server code runs. You don’t create edge functions yourself. Describe what you need in the project chat, and Lovable writes, deploys, and maintains the function. For example:
Common use cases:
  • AI-powered features, such as AI summaries or AI chatbots, using built-in Lovable AI
  • Sending emails or push notifications
  • Payment processing, for example with Stripe
  • Heavy computations or external API calls
Edge functions read API keys and credentials from your project’s secrets, so sensitive values never appear in code. For recurring work on a schedule, see Jobs.

Where your app’s server code runs

Where your app runs its server code depends on when the app was created:
  • New Lovable apps created from May 13, 2026, which use TanStack Start, run their server code inside the app itself, as server functions and API routes. Many newer apps have no edge functions at all.
  • Older React + Vite apps run their server code as edge functions, on the built-in backend.
An app you upgrade to TanStack Start can have both. Edge functions that Lovable created before the upgrade keep working until you move them into the app. Server functions and edge functions run on separate services, so a limit or a timeout on one does not apply to the other. Edge functions and server functions are updated at different times. When you restore an earlier version of your project, Lovable redeploys the edge functions from that version. Server functions and API routes are part of the app, so changes to them go live when you publish. Server functions and edge functions both run outside the visitor’s browser, so both are the right place for private credentials and for the rules your app enforces. Your app’s own pages are not the only callers. Anyone who knows the address of a server function or an edge function can send it a request, so each function has to check who sent the request. Ask Lovable in the project chat whether your app’s server code checks who sends each request. See Backend security with server-side code.

Monitor your functions

Go to More → Database → Manage → Edge functions to see every function in your project, with its status, invocation count, success rate, and when it was last updated. The time range selector has two modes: Relative covers ranges from the last 15 minutes up to the last 5 days, and Absolute lets you pick an exact start and end time. Click a function to see how it performed over time:
  • Succeeded and Failed invocation counts with a chart over the selected range.
  • Copy URL to copy the function’s endpoint.
  • View logs to open Logs pre-filtered to this function’s output.
  • View code to open the function’s source in the code editor.
If a function fails, Lovable shows the error so you can ask it to fix the problem in the project chat.

FAQ

Ask Lovable in the project chat. There is no create button in the Edge functions view: Lovable writes and deploys functions as part of building the feature you describe. To change one, describe the new behavior, or open its code with View code.
No. Edge functions are unavailable while a project is paused, so features that depend on them stop working until you resume the project. See Pause a database you’re not using.
Open the function and click View logs, which opens the Logs view filtered to that function. Each failed invocation includes the error output. You can also paste the error into the project chat and ask Lovable to fix it.
A project has a maximum number of edge functions, and a deploy fails once it reaches that number. A deployment timeout is not a limit on how long a function can run.If a function runs out of time or memory, or its bundle is too large to deploy, contact support for the figures that apply to your project. Edge function limits do not apply to your app’s own server code: see Where your app’s server code runs.
Not always. Lovable packages each function with its own files and the shared files it uses. Some deploys include only the shared files the function imports.When Lovable cannot tell safely which shared files a function needs, it includes the full shared set, so do not assume every unused file is left out.
You can ask Lovable in the project chat to deploy one or more chosen functions.Restoring an earlier version of your project redeploys every edge function from that version, not one, and only when that version changes a function at all.A restore also fails outright when the project is already at its maximum number of functions. Your app’s server routes work differently: they are part of the app, so you roll one back by restoring and publishing an earlier version. See Where your app’s server code runs.