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-worldRun 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 watcherInvoke 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" }'Self-hosting Edge Functions
Explore our templates
Simple Hello World
Basic function that returns a JSON response
Supabase Database Access
Example using Supabase client to query your database
Supabase Storage Upload
Upload files to Supabase Storage
Node Built-in API Example
Example using Node.js built-in crypto and http modules
Express Server
Example using Express.js for routing
Stream text with AI SDK
Generate and stream text with Vercel AI SDK
Generate recipes with AI SDK
Generate structured cooking recipes with Vercel AI SDK
Stripe Webhook Example
Handle Stripe webhook events securely
Send Emails
Send emails using the Resend API
Image Transformation
Transform images using ImageMagick WASM
Websocket Server Example
Create a real-time WebSocket server