From dfd1f588381699a626fdc1c52b752d19579ab848 Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Thu, 15 Oct 2026 16:23:59 +0200 Subject: [PATCH] fix(studio): use publishableKey in the Flutter connect snippet (#51792) ## Problem The Flutter snippet in the dashboard Connect sheet calls `Supabase.initialize` with `anonKey`. The current stable `supabase_flutter` (2.18.3) deprecates `anonKey` in favor of `publishableKey`, so the copied code shows a deprecation warning right away. ## Solution Pass the key as `publishableKey` and change the fallback placeholder to `your-publishable-key`. The old placeholder told users to prefer the publishable key over the anon key, which no longer makes sense once the parameter itself is named `publishableKey`. ## Review instructions 1. Open a project in the dashboard and click Connect. 2. Choose Framework, then Flutter. 3. Check that `lib/main.dart` calls `Supabase.initialize(url: ..., publishableKey: ...)`. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) --- .../ConnectSheet/content/flutter/supabaseflutter/content.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/studio/components/interfaces/ConnectSheet/content/flutter/supabaseflutter/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/flutter/supabaseflutter/content.tsx index 90a7b36f2c4..3903c9f2fb4 100644 --- a/apps/studio/components/interfaces/ConnectSheet/content/flutter/supabaseflutter/content.tsx +++ b/apps/studio/components/interfaces/ConnectSheet/content/flutter/supabaseflutter/content.tsx @@ -14,7 +14,7 @@ import 'package:supabase_flutter/supabase_flutter.dart'; Future main() async { await Supabase.initialize( url: '${projectKeys.apiUrl ?? 'your-project-url'}', - anonKey: '${projectKeys.publishableKey ?? ''}', + publishableKey: '${projectKeys.publishableKey ?? 'your-publishable-key'}', ); runApp(MyApp()); }