Repository navigation
feat(supabase): add namespace option and /dev entry point - #2791
Draft
sweatybridge wants to merge 4 commits into
Draft
sweatybridge wants to merge 4 commits into
sweatybridge wants to merge 4 commits into
Conversation
`pathPrefix` prepends a folder to every object path in every bucket and strips it from paths and names returned by the API, so callers can keep using relative paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JGHpsXzX74YQxtqBX35BTx
`namespace` prefixes Realtime topics and Storage paths, sends an `x-supabase-namespace` header on every request, and scopes the default auth storage key. `namespaceFrom(req)` lets server-side code adopt the caller's namespace. `@supabase/supabase-js/dev` adds `devSession`, which creates a namespaced client for one development session on a shared branch, with branch and key guards, test sign-in, `uniq` and a scoped `adminClient`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JGHpsXzX74YQxtqBX35BTx
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JGHpsXzX74YQxtqBX35BTx
Contributor
Author
|
Generated by Claude Code |
…espace Covers database, auth, storage, vectors, analytics and functions requests, and fails when a StorageFileApi method is added without being classified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JGHpsXzX74YQxtqBX35BTx
This branch has not been deployed
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.
🔍 Description
What changed?
Implements the RFC "Namespaced sessions on a shared branch".
createClient(url, key, { namespace: 's07' }): prefixes Realtime topics (s07:room) and Storage paths (s07/a.png), sendsx-supabase-namespaceon every request, and adds the namespace to the default authstorageKey. Unset = no change.namespaceFrom(req): lets server code adopt the caller's namespace. The header is added tocorsHeaders.pathPrefix: prefixes input paths and strips the prefix from returned paths/names.fullPathis left as is.@supabase/supabase-js/dev:devSession({ slot, branchRef, signInAs })with branch/key guards, test sign-in,uniq(), and a scopedadminClient({ scope }).Why was this change needed?
Lets many dev sessions share one branch without a branch per session.
🔄 Breaking changes
📋 Checklist
pnpm nx format📝 Additional notes
How the RFC's open questions are answered here:
:for topics,/for paths (Q2).x-supabase-namespace(Q3).NODE_ENV=production:devSessionrefuses to run (Q6).upsert: only allowed withignoreDuplicates: true, since an update on conflict could overwrite rows outside the scope.The capability matrix has no feature for these yet, so the new symbols are under the top-level
supporting_symbolsinsdk-compliance.yamluntil one is added in supabase/sdk.The storage-js integration suites were not run locally because Docker isn't available.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JGHpsXzX74YQxtqBX35BTx