This repository was archived by the owner on Aug 7, 2026. It is now read-only.
Repository navigation
feat: add structured X-Client-Info header metadata - #2
Merged
Tr00d merged 5 commits intoJul 14, 2026
Merged
Conversation
Extends GetAssemblyVersion to append platform, runtime, and framework metadata to the X-Client-Info header per the consolidated SDK spec. Adds a CoreTests project with coverage for format correctness, required fields, and framework detection in a plain dotnet environment.
Tr00d
marked this pull request as ready for review
July 13, 2026 12:22
QuintinWillison
approved these changes
Jul 13, 2026
QuintinWillison
left a comment
Member
There was a problem hiding this comment.
Nice. 💪 - just one small thought...
spydon
reviewed
Jul 13, 2026
grdsdev
reviewed
Jul 13, 2026
spydon
added a commit
to supabase/supabase-flutter
that referenced
this pull request
Jul 14, 2026
) ## What Normalizes the platform name reported in the `platform=` segment of the `X-Client-Info` header so it uses the same casing across all Supabase SDKs. Previously the Flutter SDK sent the raw `Platform.operatingSystem` value, which is always lowercase (`macos`, `ios`, `android`, `linux`, `windows`). Swift reports properly cased names (`macOS`, `iOS`, `Android`, `Linux`, `Windows`). This mismatch made it harder to aggregate stats per platform independently of framework/language. ## Changes - Added `normalizePlatformName` in `supabase_common` backed by a lookup map that maps each `Platform.operatingSystem` value to the shared, Swift-aligned casing. Unknown values pass through unchanged so any new platform still shows up in stats. - `conditionalPlatform` (the `dart:io` implementation) now runs `Platform.operatingSystem` through `normalizePlatformName`. This is the single source used by both the `supabase` (pure Dart) and `supabase_flutter` packages, so both are covered. - Updated tests accordingly. Only the platforms `dart:io` can actually report are mapped. visionOS, watchOS, and tvOS aren't Flutter targets, and the alignment discussion concluded those three aren't valuable to track. ## Context Follows the casing agreement in supabase-community/core-csharp#2 ([discussion](supabase-community/core-csharp#2 (comment))).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Supabase is consolidating client metadata into the existing
X-Client-Infoheader rather than adding new headers, which would be a breaking change for Edge Function users who must explicitly allowlist headers in their CORS config.Closes #255
Changes
Extends
Util.GetAssemblyVersionincore-csharpto append semicolon-delimited metadata after the library token:Parameters included:
platform—Windows,Linux,macOS, orbrowser(Blazor WASM)platform-version— OS version, omitted for browserruntime— alwaysdotnetruntime-version— e.g.8.0.27framework—maui,unity, orblazorwhen detectable; omitted otherwiseFramework detection scans loaded assemblies with explicit priority (MAUI wins over Blazor in hybrid apps). All parameters follow the spec: omitted entirely when the value cannot be determined, never set to empty or
unknown.All SDKs pick this up automatically since they all call
Util.GetAssemblyVersion.Tests
Adds a
CoreTestsproject (first test project incore-csharp) with 7 tests covering format integrity, required fields, valid platform values, and framework absence in a plain dotnet environment.