Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Summary
Change: Feature Merge Risk:
|
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
7c1936b to
dd2a1c4
Compare
…t-Info Libraries built on supabase-js had to replace the whole X-Client-Info header to identify themselves, which drops the SDK's own platform and runtime parameters. global.clientInfo appends key=value parameters to the resolved header instead. Refs SDK-1877 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
dd2a1c4 to
f9a5674
Compare
…served keys The reserved key list stays in helpers.ts only. The clientInfo JSDoc and the README point to the spec for the key and value rules. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔍 Description
What changed?
This PR adds a
global.clientInfooption tocreateClient. A way to append a map ofkey: valuepairs to theX-Client-Infoheader, e.g.:The
createClientfunction throws when:^[A-Za-z0-9_-]+$platform,platform-version,platform-architecture,runtime,runtime-version,framework,framework-version,features), or is already in the caller's headerValues are trimmed, and
;,%and anything outside printable ASCII are percent-encoded as UTF-8, based on the spec.Why was this change needed?
To improve library detection, such as in
@supabase/serveras the consumer.🔄 Breaking changes
The option is new and optional. Existing callers who set
global.headers['X-Client-Info']still replace the default as before, and the result is unchanged whenclientInfois not set.📋 Checklist
<type>(<scope>): <description>pnpm nx formatto ensure consistent code formatting📝 Additional notes
Spec updates in supabase/sdk are coming.
AI-assisted generated summary
Written with Claude Code and reviewed by me, including an independent review pass that found and fixed an emoji encoding bug (missing
uregex flag).Files:
src/lib/types.ts(option and JSDoc),src/lib/helpers.ts(appendClientInfo, called fromapplySettingDefaults),src/lib/constants.ts(CLIENT_INFO_HEADER),src/SupabaseClient.ts(option list),README.md, and two test files.🤖 Generated with Claude Code