supabase-flutter
AGENTS.md1k starsChanged 2 months agoMITView on GitHub
This file provides guidance to the agents when working with code in this repository. This is a monorepo for the Supabase Flutter SDK, managed by Melos. It contains multiple independently versioned packages that provide Flutter and Dart clients for Supabase services. The repository follows a layered dependency structure: Key architectural patterns: - SupabaseClient is a facade that initializes and coordinates all sub-clients - AuthHttpClient wraps HTTP requests to inject JWT tokens automatically - Builder/fluent interface pattern for query construction (from().select().eq())…
Trending
Quiet since October.about the whole repository
Who's talking about supabase/supabase-flutter
- supabase/supabase-js“Full Name not stored in Database when Using Apple Sign-In in React Native”GitHub · Nov 2, 2023 · 21 reactions
- supabase/gotrue-dart“Add experimental signInWithIdToken for Apple, Google”GitHub · Feb 3, 2023 · 11 reactions
- davidmigloz/langchain_dart“Add support for Supabase VectorStore”GitHub · Jul 11, 2023 · 6 reactions
- supabase/auth“Only the information requested by the scope is not imported. and not response phone_number data”GitHub · Feb 21, 2024 · 2 reactions
- supabase/walrus“Realtime events not emitted when used with `eq` filter and the row no longer meets the `eq` condition due …”GitHub · Jan 6, 2023 · 2 reactions
The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 27
Talked about on GitHub (27 times).
On GitHub · 27
- Nov 2, 2023Full Name not stored in Database when Using Apple Sign-In in React Native — supabase/supabase-js21 reactions · 24 comments
- Feb 3, 2023Add experimental signInWithIdToken for Apple, Google — supabase/gotrue-dart11 reactions · 12 comments
- Jul 11, 2023Add support for Supabase VectorStore — davidmigloz/langchain_dart6 reactions · 10 comments
- Feb 21, 2024Only the information requested by the scope is not imported. and not response phone_number data — supabase/auth2 reactions · 10 comments
- Jan 6, 2023Realtime events not emitted when used with `eq` filter and the row no longer meets the `eq` condition due to update — supabase/walrus2 reactions · 6 comments
22 more on GitHub
- Nov 20, 2021[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getInitialLink on channel uni_links/messages) — avioli/uni_links2 reactions · 2 comments
- Jul 22, 2024Add `usePathUrlStrategy` to web setup instructions — supabase/supabase1 reaction · 2 comments
- Sep 15, 2023fix: Update flutter code on apple auth docs to use the latest Flutter SDK features — supabase/supabase1 reaction · 1 comment
- Jun 30, 2023fix: don't remove session in resend — supabase/auth-js1 reaction · 2 comments
- Apr 13, 2023Add `signInWithApple` method — supabase-community/gotrue-swift1 reaction · 4 comments
- Feb 15, 2023Unchanged toast from old_record — supabase/walrus1 reaction
- Oct 5, 2026chore(deps): bump supabase_flutter from 2.17.2 to 2.18.0 in /mobile — su-resh/disaster-management0 reactions
- Oct 5, 2026chore(deps): bump supabase from 2.16.1 to 2.16.2 — enzoftware/hotelyn0 reactions · 1 comment
- Oct 5, 2026chore(deps): Bump supabase_flutter from 2.17.2 to 2.18.0 — PurnaJear06/Tracend0 reactions
- Oct 5, 2026chore(deps): bump supabase_flutter from 2.17.2 to 2.18.0 in the network group — edukreatifnusantara-ai/edukreatif_mobile0 reactions · 1 comment
- Oct 5, 2026Bump supabase_flutter from 2.17.2 to 2.18.0 — Ali-Assi-1994/telos0 reactions
- Oct 5, 2026chore(deps): bump the dart-minor-and-patch group across 1 directory with 4 updates — MaximeLemesle/nanimo0 reactions
- Oct 5, 2026chore(deps): bump supabase_flutter from 2.17.2 to 2.18.0 — Future-Atlas/sharemarium0 reactions · 1 comment
- Oct 5, 2026chore(deps): bump supabase_flutter from 2.17.2 to 2.18.0 — Christian0162/voya0 reactions · 1 comment
- Oct 4, 2026deps: bump the pub group in /mobile with 2 updates — PEEKYPAUL/Moongate0 reactions
- Oct 4, 2026chore(deps): bump supabase_flutter from 2.17.1 to 2.18.0 in /petsewa_app — Vk2533120/petsewa_backrnd0 reactions · 1 comment
- Oct 4, 2026build(deps)(deps): bump supabase_flutter from 2.12.4 to 2.18.0 in /src — tqha1011/TaskManagement0 reactions · 1 comment
- Oct 4, 2026chore(deps): bump supabase_flutter from 2.16.0 to 2.18.0 — mostafasayed118/Law_App0 reactions
- Oct 4, 2026build(deps): bump supabase_flutter from 2.17.2 to 2.18.0 — youngyouth22/scriptless0 reactions · 1 comment
- Oct 3, 2026Bump supabase_flutter from 2.17.2 to 2.18.0 in /mobile — Kofi-Astro/church-app0 reactions
- Oct 3, 2026chore(deps): bump supabase_flutter from 2.17.2 to 2.18.0 — gruprsvp/grup0 reactions
- Sep 26, 2026chore(deps): Bump supabase_flutter from 2.12.2 to 2.18.0 in /mobile in the supabase group across 1 directory — TitaniaAnn/my-budget-app0 reactions
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 115
Put a client into a signed-in state with signInTestUser, and build server payloads with testUserJson, testSessionResponseJson and …
- Distinctive: line 205
All clients accept options classes for customization:
- Very specific: line 238
Run melos analyze and melos format before committing
- Distinctive: line 239
Ensure tests pass for modified packages
- Distinctive: line 240
Update package changelogs if making notable changes
- Very specific: line 244
Use dart format for consistent formatting
- Very specific: line 248
Every exported public symbol must be declared in sdk-compliance.yaml at the repo root, or the "SDK Compliance" CI check fails.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file provides guidance to the agents when working with code in this repository.
Overview
This is a monorepo for the Supabase Flutter SDK, managed by Melos. It contains multiple independently versioned packages that provide Flutter and Dart clients for Supabase services.
Package Architecture
The repository follows a layered dependency structure:
- supabase_flutter: Flutter-specific wrapper with platform integrations (deep links, local storage, app lifecycle)
- supabase: Core Dart client that orchestrates all service clients
- supabase_auth: Authentication client (sessions, JWT, OAuth)
- postgrest: Database query client with ORM-style API
- supabase_realtime: WebSocket client for real-time subscriptions
- supabase_storage: File storage client with retry logic
- iceberg: Apache Iceberg REST Catalog client used by storage analytics buckets
- supabase_functions: Edge functions invocation client
- yet_another_json_isolate: JSON parsing in separate isolate for performance
Key architectural patterns:
SupabaseClientis a facade that initializes and coordinates all sub-clientsAuthHttpClientwraps HTTP requests to inject JWT tokens automatically- Builder/fluent interface pattern for query construction (
from().select().eq()) - Stream-based reactive pattern using RxDart
BehaviorSubject - Platform-specific code via conditional imports (web vs native)
Development Setup
# Install Melos globally (if not already installed)
dart pub global activate melos
# Bootstrap dependencies for all packages
melos bootstrap
# or shorthand:
melos bsCommon Commands
Linting and Formatting
# Run the analyzer across the whole workspace
melos analyze
# Format code (80 char line length, configured in the root pubspec.yaml)
melos formatTesting
Most packages have unit tests. The postgrest, supabase_auth, supabase_realtime, and supabase_storage packages run against a local Supabase stack started with the Supabase CLI. This requires Docker and the Supabase CLI installed.
For packages requiring a backend (postgrest, supabase_auth, supabase_realtime, supabase_storage):
# 1. Start the local Supabase stack from the repository root
supabase start
# 2. Run tests (from the package directory)
cd packages/<package>
dart test -j 1
# 3. Stop the stack when done (from the repository root)
supabase stopThe single supabase/ config at the repository root serves every package: its migrations and seed.sql create the schemas, functions, and test data all four packages rely on. The stack binds ports 14420 to 14429 (gateway on http://127.0.0.1:14421, database on 127.0.0.1:14422), off the CLI defaults so it can run alongside another local Supabase project and below Linux's default ephemeral port range so an outgoing connection cannot claim a port the stack still needs to bind.
The -j 1 flag runs tests sequentially (not concurrently), which is required since tests share the same backend.
For packages without a backend requirement:
# Run tests from package directory
cd packages/<package>
dart testRun every package's tests at once:
# Runs `dart test`/`flutter test` in each package that has a test/ directory.
# Start the local Supabase stack first (see above) so the backend packages pass.
melos testRun tests with coverage (from a package directory):
cd packages/<package>
dart test --coverage=coverageRunning a Single Test File
# From package directory
dart test test/specific_test.dart
# For a specific test case
dart test test/specific_test.dart -n "test name pattern"Writing Tests
Build tests on the supabase_test package instead of writing mocks by hand:
- Answer HTTP calls with
MockSupabaseHttpClientand itsstub,stubHandler,stubErrorandstubTable/stubRpc/stubStorage*helpers. Do not subclassBaseClientin a test. Match methods withHttpMethod.post.valueand friends rather than raw strings. - Assert on what was sent with
requestsandrequestsTo(path, method:). - Put a client into a signed-in state with
signInTestUser, and build server payloads withtestUserJson,testSessionResponseJsonandunsignedTestJwt. Do not hand-assemble JWTs or session JSON. - Construct clients with
testSupabaseClientwhere a wholeSupabaseClientis needed.
Fakes for things supabase_test does not cover, such as a platform plugin interface, are written in the test file itself.
Package Management
# Upgrade dependencies across the whole workspace (run at the repository root)
dart pub upgrade
# Check for outdated dependencies
dart pub outdatedVersion Management
# Update version.dart files for all packages
melos run update-version
# Version packages and generate changelogs (handled by melos)
melos versionKey Implementation Details
Authentication Flow
- AuthClient manages sessions, tokens, and JWT validation
- Emits auth state changes via
Stream<AuthState> - supabase_flutter adds session persistence via
SharedPreferencesAsync(mobile) or browser localStorage (web) - Deep link handling for OAuth callbacks (detects
?code=for PKCE or#access_token=for implicit flow) - Auth tokens are automatically injected into all HTTP requests via
AuthHttpClient - Realtime client receives token updates when auth state changes
Query Building
PostgREST queries use a chain of builder classes:
PostgrestQueryBuilder → PostgrestFilterBuilder → PostgrestTransformBuilder → PostgrestBuilder<T>Example: supabase.from('users').select('id, name').eq('id', 1).limit(10)
PostgrestBuilder<T> is the executable base: T is what awaiting the request resolves to. Steps
that change the result (select(), single(), count(), withConverter()) each supply a decoder
for the response, and the decoders compose in call order, so the converter always receives whatever
the chain resolved to right before it.
The typed builders returned by client.table(...) (PostgrestTypedQueryBuilder →
PostgrestTypedFilterBuilder → PostgrestTypedTransformBuilder → PostgrestTypedBuilder<T>) do
not wrap untyped builders. Each method returns a copy holding an immutable PostgrestTableRequest
that describes the query as structured values (operation, columns, filter, orderings, payload, and
PostgrestRequestOptions for headers, retry, timeout and abort signal). Awaiting the builder hands
the request to a PostgrestTableExecutor and converts the PostgrestTableResult into the table's
Row type. The default PostgrestHttpTableExecutor renders the request through the untyped
builders at execution time, so both APIs send the same wire request; another executor (a
SupabaseClientPlugin can wrap it) may cache, queue or answer from a local store instead.
Realtime Architecture
SupabaseStreamBuildercombines initial PostgREST data fetch with realtime updates- Uses RxDart
BehaviorSubjectfor reactive streams - WebSocket maintains persistent connection with 30s heartbeat
- Auto-reconnect with exponential backoff on disconnect
Error Handling
Each package has its own exception hierarchy:
- supabase_auth:
AuthException(base), with specialized subclasses likeAuthApiException,AuthRetryableFetchException - postgrest: HTTP-based error responses
- realtime:
RealtimeSubscribeExceptionwith status tracking - storage: Retry logic with exponential backoff, opt-in through
SupabaseRetryOptions
Platform Differences
The codebase uses conditional imports for platform-specific implementations:
import './local_storage_stub.dart'
if (dart.library.js_interop) './local_storage_web.dart'This enables:
- Native mobile (iOS/Android): SharedPreferencesAsync for persistence
- Web: Browser localStorage
- Single codebase for all platforms
Client Configuration
All clients accept options classes for customization:
PostgrestClientOptions: Custom schema accessAuthClientOptions: Auto-refresh tokens, PKCE vs implicit flowStorageClientOptions: Retry configuration for uploadsFunctionsClientOptions: Edge function region selectionRealtimeClientOptions: WebSocket timeout configuration
URL Structure
The SupabaseClient transforms a base URL into service-specific endpoints:
supabaseUrl: "https://project.supabase.co"
├─ REST: "https://project.supabase.co/rest/v1"
├─ Realtime: "ws://project.supabase.co/realtime/v1"
├─ Auth: "https://project.supabase.co/auth/v1"
├─ Storage: "https://project.supabase.co/storage/v1" (or dedicated host)
└─ Functions: "https://project.supabase.co/functions/v1"Testing Against Local Supabase
For integration testing, you may want to point to a local Supabase instance:
await Supabase.initialize(
url: 'http://localhost:54321',
publishableKey: 'your-local-supabase-key',
);Contributing Guidelines
- Fork the repo and create feature branches
- Run
melos analyzeandmelos formatbefore committing - Ensure tests pass for modified packages
- Update package changelogs if making notable changes
- Any change that breaks the public API adds its own section to
MIGRATION.mdin the same pull request, under the major version it will ship in - Line length limit is 80 characters
- Use
dart formatfor consistent formatting
Adding a new public API
Every exported public symbol must be declared in sdk-compliance.yaml at the
repo root, or the "SDK Compliance" CI check fails. If the capability already
exists in the SDK capability matrix
(capabilities/<area>.yaml there), just register your symbols. If it doesn't
exist yet, open a PR on that repo first to declare it; once it's merged and
released, bump the pinned SHA in
.github/workflows/validate-capabilities.yml
to the new capability-matrix/vX.Y.Z tag, then register the symbols here,
entry points under symbols, everything else (params, response types, etc.)
under supporting_symbols:
auth.mfa_recovery_codes.generate:
status: implemented
symbols:
- AuthClient.generateMfaRecoveryCodes
supporting_symbols:
- MFARecoveryCodesGenerateResponseDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

