feat(supabase): consolidate client metadata into structured X-Client-Info header#986
Draft
feat(supabase): consolidate client metadata into structured X-Client-Info header#986
Conversation
…Info header Replace separate X-Supabase-Client-Platform and X-Supabase-Client-Platform-Version headers with a single semicolon-delimited X-Client-Info value: supabase-swift/2.45.0; platform=iOS; platform-version=18.5.0; runtime=swift; runtime-version=5.10 This avoids the need to add new HTTP headers for future metadata fields. Adding a new header in supabase-js is a breaking change because users must explicitly allow headers in their CORS config when running in Edge Functions — X-Client-Info is already in every allowlist. Also adds runtime (always "swift") and runtime-version (detected at compile time via #if swift(...) chain) which were not previously sent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ient-Info format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b8cbc8e to
5ea65de
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Consolidates the separate
X-Supabase-Client-PlatformandX-Supabase-Client-Platform-Versionheaders into a single structuredX-Client-Infovalue using semicolon-delimitedkey=valuepairs (same convention asContent-Typeparams):Also adds two new fields that weren't previously sent:
runtime(alwaysswift) andruntime-version(detected at compile time via#if swift(...)chain).Why
Adding a new header in supabase-js is a breaking change — when the JS client runs inside an Edge Function, users define their CORS allowed headers explicitly, so any new header we introduce gets blocked until users update their config.
X-Client-Infois already present in every allowlist, so extending it as a structured value lets us add new metadata fields freely without touching CORS or coordinating across all client libs.Changes
Sources/Helpers/Version.swift— addsruntimeVersionusing a compile-time#if swift(...)chain, following the same debug/test override pattern asplatformandplatformVersionSources/Supabase/Constants.swift— builds the consolidatedX-Client-Infovalue; removes the two standalone platform headersNotes for reviewers
;, first segment islib/version, rest arekey=valuepairsclientInfo += "; key=value"line, no new headersCloses SDK-905