"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&#x27;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&#x27;s auth forwarded automatically. In this tutorial you&#x27;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&#x27;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&#x27;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&#x27;s the client side — this is the whole API surface you&#x27;ll use from Flutter: // lib/edge/hello_service.dart import &#x27;package:supabase_flutter/supabase_flutter.dart&#x27;; class HelloService { HelloService(this._client); final SupabaseClient _client; Future<String> greet(String name) async { final response = await _client.functions.invoke( &#x27;hello&#x27;, // function name = folder name under supabase/functions/ body: {&#x27;name&#x27;: name}, headers: {&#x27;x-request-id&#x27;: &#x27;req_${DateTime.now().millisecondsSinceEpoch}&#x27;}, ); // response.data is the decoded JSON body;…

Explore