Edge Functions

Deploy edge functions to handle complex business logic

Developing Edge Functions locally

Create an Edge Function

Create a new edge function called hello-world in your project via the Supabase CLI.

supabase functions new hello-world
Docs

Run Edge Functions locally

You can run your Edge Function locally using supabase functions serve.

supabase start # start the supabase stack
supabase functions serve # start the Functions watcher
Docs

Invoke Edge Functions locally

While serving your local Edge Functions, you can invoke it using cURL or one of the client libraries.

curl --request POST 'http://localhost:54321/functions/v1/hello-world' \
  --header 'Authorization: Bearer SUPABASE_ANON_KEY' \
  --header 'Content-Type: application/json' \
  --data '{ "name":"Functions" }'
Docs

Self-hosting Edge Functions

Self-hosting Edge Functions

Supabase Edge Runtime consists of a web server based on the Deno runtime, capable of running Javascript, Typescript, and WASM services. You may self-host edge functions on providers like Fly.io, Digital Ocean, or AWS.

Explore our templates