"supabase.functions.invoke Flutter: Edge Functions Guide"
"Call serverless logic with supabase.functions.invoke Flutter: write Deno edge functions, pass headers/auth, fix CORS, manage secrets, deploy. Runnable code."
Some logic doesn't belong in your app. Charging a credit card, verifying a webhook signature, calling a paid third-party API — put any of that in client code and someone will extract your secret key within a week. Supabase Edge Functions give you a serverless Deno runtime sitting next to your database, and supabase.functions.invoke flutter is the one Dart call that reaches it: pass a body, get JSON back, with the user's auth forwarded automatically. In this tutorial you'll write a TypeScript edge function, deploy it, and call it from Flutter 3.x with supabase_flutter 2.18.x — including custom headers, auth forwarding, CORS, secrets, and a real Stripe webhook handler pattern. Last updated: October 3, 2026 What you'll learn What edge functions are (and when to use one vs a database function) Writing an edge function in Deno/TypeScript Deploying with the Supabase CLI and testing locally Calling it from Dart with supabase.functions.invoke Passing custom headers and the user's auth token CORS handling that actually works Managing secrets safely A Stripe webhook handler pattern supabase.functions.invoke Flutter: The Dart API Before writing any server code, here's the client side — this is the whole API surface you'll use from Flutter: // lib/edge/hello_service.dart import 'package:supabase_flutter/supabase_flutter.dart'; class HelloService { HelloService(this._client); final SupabaseClient _client; Future<String> greet(String name) async { final response = await _client.functions.invoke( 'hello', // function name = folder name under supabase/functions/ body: {'name': name}, headers: {'x-request-id': 'req_${DateTime.now().millisecondsSinceEpoch}'}, ); // response.data is the decoded JSON body;…