Deploy and manage Supabase Edge Functions
.env
files for local development and the Supabase dashboard for production secrets:
.env
file is git-ignored by defaultSERVICE_ROLE_KEY
when absolutely necessarysupabase functions serve
. This command starts a local server that mimics the production environment, allowing you to test your functions as if they were deployed.
For the user-self-delete function specifically, you can run:
console.log()
statements strategically to debug issues, but remember to remove or condition them before deploying to production. For production errors, console.error()
statements are automatically captured in the dashboard logs.
The dashboard also provides insights into your function’s performance metrics, including execution time and memory usage. While function alerts are coming soon, you can monitor these metrics manually to ensure optimal performance.
.env
file in your local environment should mirror the structure of your production secrets while using development-safe values.