Edge Functions

Deploy to Production

Deploy your Edge Functions to your remote Supabase Project.

Once you have developed your Edge Functions locally, you can deploy them to your Supabase project.

Login to the CLI

Log in to the Supabase CLI if necessary:


_10
supabase login

Get your project ID

Get the project ID associated with your function by running:


_10
supabase projects list

Link your local project to your remote Supabase project using the ID you just retrieved:


_10
supabase link --project-ref your-project-id

Deploy your Edge Functions

You can deploy all of your Edge Functions with a single command:


_10
supabase functions deploy

You can deploy individual Edge Functions by specifying the name of the function in the deploy command:


_10
supabase functions deploy hello-world

By default, Edge Functions require a valid JWT in the authorization header. If you want to use Edge Functions without Authorization checks (commonly used for Stripe webhooks), you can pass the --no-verify-jwt flag when deploying your Edge Functions.


_10
supabase functions deploy hello-world --no-verify-jwt

Be careful when using this flag, as it will allow anyone to invoke your Edge Function without a valid JWT. The Supabase client libraries automatically handle authorization.

Invoking remote functions

You can now invoke your Edge Function using the project's ANON_KEY, which can be found in the API settings of the Supabase Dashboard.

cURL
JavaScript

_10
curl --request POST 'https://<project_id>.supabase.co/functions/v1/hello-world' \
_10
--header 'Authorization: Bearer ANON_KEY' \
_10
--header 'Content-Type: application/json' \
_10
--data '{ "name":"Functions" }'

You should receive the response { "message":"Hello Functions!" }.