You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider replacing @supabase/supabase-js with direct fetch calls #331
@supabase/supabase-js is one of our largest runtime dependencies, but we use only two small parts of it:
src/gateways/supabase-gateway.ts: one Storage call to create a signed upload URL (the upload itself already goes through tus-js-client).
src/gateways/cli-auth-gateway.ts: refreshing a session (auth.refreshSession), plus the error helpers isAuthApiError and isAuthSessionMissingError.
Both are plain HTTP endpoints that we could call with fetch.
Why
A much smaller dependency tree and a smaller standalone binary.
Fewer transitive packages to receive security advisories for.
Risks
Session refresh is subtle. The current code depends on how supabase-js maps auth errors. For example, it turns session_not_found into a "session missing" error. A replacement must keep this behaviour exactly, or users could be logged out by mistake, or a dead session could keep retrying. The refresh paths would need tests first.
We would take on tracking any API changes ourselves.
Suggestion
Only do this if binary size or dependency count becomes a real concern. If we do it, start with the Storage call (simple) and leave auth refresh for last, behind tests.
Done on dev: #313 moved session refresh to the dcd API, and #358 removed the unused signed-URL upload path, which was the last user of @supabase/supabase-js, and dropped the dependency. It ships with the next CLI release.
Activity
finalerock44 commentedon Nov 24, 2026
Done on
dev: #313 moved session refresh to the dcd API, and #358 removed the unused signed-URL upload path, which was the last user of@supabase/supabase-js, and dropped the dependency. It ships with the next CLI release.