Skip to content

spec: add 0002-x-client-info-header - #3

Closed
grdsdev wants to merge 3 commits into
mainfrom
spec/0002-x-client-info-header
Closed

grdsdev wants to merge 3 commits into
mainfrom
spec/0002-x-client-info-header

Conversation

@grdsdev

@grdsdev grdsdev commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds specs/0002-x-client-info-header.md — the behavior contract for the X-Client-Info HTTP header sent by all Supabase client libraries.

  • Format: name/version library token followed by ; key=value parameters (semicolon-delimited, Content-Type convention)
  • Defined parameters: platform, platform-version, runtime, runtime-version, framework, framework-version — all SHOULD, omitted when not determinable
  • Sub-client inheritance: sub-clients initialized via a parent inherit the parent's header; standalone sub-clients set their own
  • Parameter order: not mandated — parsers must locate by key
  • User-supplied header: library must not modify it

Background

The motivation for this spec is that adding a new HTTP header in supabase-js is a breaking change for applications running the client inside Edge Functions — users must explicitly allowlist headers in their CORS config. X-Client-Info is already in every allowlist, so extending it as a structured value lets all client libraries add new metadata fields without touching CORS or coordinating across SDKs.

Reference implementation: supabase/supabase-swift#986

Status

Draft — requesting team feedback before moving to Review.

grdsdev and others added 3 commits May 5, 2026 06:49
Defines the structure and content of the X-Client-Info HTTP header sent
by all Supabase client libraries — format, defined parameters (platform,
platform-version, runtime, runtime-version, framework, framework-version),
omission rules, and sub-client inheritance behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `framework` to Definitions
- R2.5: remove out-of-scope parser normative text; parser behaviour is a
  data pipeline responsibility, not a client library requirement
- Changelog 0.2.0: note that former R3.5 (omission rule) was renumbered to R3.7
- Add rationale entries for two uncovered SHOULDs: R3.1 (closest table
  value) and R3.2 (platform-version format follows host convention)
- Regroup scenarios into Format / Inheritance / Parameters / Framework
- Fix standalone-sub-client Expected: remove undefined [; ...] notation,
  be explicit about library token
- Fix framework-detected Expected: replace <detected-version> placeholder
  with concrete version and source description
- Add platform-included and runtime-included scenarios for R3.1/R3.3/R3.4
  positive cases
- Remove parameter-key-lookup scenario (tested parser behaviour, out of scope)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r (0.2.2)

- R2.2: reword to "When parameters are present, each MUST be separated…"
  so the requirement is not read as mandating parameters always exist,
  consistent with the zero-or-more ABNF in R2.4
- missing-platform-version scenario: replace informal <value> placeholder
  with concrete wording referencing the R3.1 defined-values table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 5, 2026

Copy link
Copy Markdown
SDK-923 Set up supabase/sdk spec and tooling repository

Summary

Created the supabase/sdk repository as the canonical home for cross-SDK behavioral specs, Claude Code skills, and SDK team tooling.

Work done so far

  • Spec format — RFC 2119-style spec format with named scenario slugs and status/version lifecycle fields
  • specs/0001-postgrest-retry.md — first spec defining automatic retry behavior for PostgREST clients
  • specs/0002-x-client-info-header.md — spec for the structured X-Client-Info header format (PR open)
  • SDK implementation status matrix — tracks implementation status of each spec across all SDKs
  • Claude Code skills — sdk-spec, review-spec, and review-spec-compliance skills for enforcing spec format and checking SDK compliance
  • Install script — scripts/install-skills.sh for one-command skill installation
  • README — repo overview and quick-start guide

Open PRs

References

@grdsdev
grdsdev deleted the spec/0002-x-client-info-header branch June 17, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant