Supabase+Edge Functions
Stack IntegrationSupabase Edge Functions: Server-Side Logic Guide
Supabase Edge Functions run Deno-based TypeScript at the edge — the right place for webhook handlers, third-party API calls, and any server-side logic that shouldn't touch your client.
Use Cases
- Stripe webhook handler verifying signatures and updating Postgres
- Transactional email dispatch triggered by Postgres database events
- Third-party API calls (Resend, Twilio, OpenAI) keeping secret keys server-side
- Custom auth hooks running business logic on sign-up or sign-in
Implementation
Deploy with `supabase functions deploy <function-name>`. Edge Functions run on Deno — use `import` syntax and URL imports for dependencies. Access Supabase Postgres from within an Edge Function using the service role key stored in the function's environment variables (never expose it to clients). For Postgres-triggered functions, wire a database webhook in the Supabase dashboard to call your Edge Function URL on insert/update/delete events.