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
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
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" }'
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
OpenAI Text Completion
Generate text completions using OpenAI GPT-3
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