@supabase/ssr

The official framework-agnostic Supabase client for server-side rendering apps, handling cookie-based auth sessions.

SDK
npm
v0.12.4
206stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
84/100Excellent
Development Activity92
Maintenance100
Community72
Maturity44
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture82
Code Quality88
Innovation72
Learning Curve78

@supabase/ssr is Supabase’s official package for using the Supabase JavaScript client inside server-side rendering (SSR) frameworks — Next.js, Remix, SvelteKit, and others — where auth state has to travel through cookies instead of just browser storage. It replaces the older, framework-specific @supabase/auth-helpers-* packages (auth-helpers-nextjs, auth-helpers-react, auth-helpers-remix, auth-helpers-sveltekit), which have all been deprecated and consolidated into this single, framework-agnostic library.

The package exposes createBrowserClient() and createServerClient(), plus cookie-handling utilities that correctly read, write, and refresh Supabase session cookies across server components, middleware, and route handlers. It documents real edge cases up front — like concurrent requests racing to refresh the same single-use refresh token — and recommends patterns (e.g. refreshing sessions once per navigation in middleware) to avoid them.

What You Get

  • createServerClient() and createBrowserClient() functions that wrap @supabase/supabase-js with cookie-aware session handling
  • Cookie read/write/refresh utilities (cookies.ts) that keep auth sessions in sync between server and browser
  • clearAuthCookiesAtScopes() for correctly clearing session cookies across scopes on sign-out
  • Framework-agnostic design that replaces the deprecated auth-helpers-nextjs/react/remix/sveltekit packages with one library
  • Documented guidance on known limitations, like concurrent-request races against single-use refresh tokens

Common Use Cases

  • Reading and refreshing a Supabase auth session in Next.js middleware, server components, and route handlers
  • Migrating an app off a deprecated @supabase/auth-helpers-* package onto the consolidated, actively maintained client
  • Implementing cookie-based auth in Remix or SvelteKit apps that talk to Supabase
  • Keeping browser and server Supabase clients in sync so a user’s session persists correctly across navigations

Under The Hood

Architecture — The package centers on two entry points: createServerClient.ts (199 lines) for server-side contexts, which wires cookie get/set/remove callbacks into a @supabase/supabase-js client instance, and createBrowserClient.ts (153 lines) for the browser equivalent. Shared cookie-parsing/serialization logic lives in cookies.ts (600 lines), the largest source file, which handles Supabase’s chunked-cookie format (session data that exceeds a single cookie’s size limit gets split across multiple cookies) and cross-scope cookie clearing via clearAuthCookiesAtScopes.ts.

Tech Stack — TypeScript throughout, built on top of @supabase/supabase-js as its core dependency, with Vitest for testing and tsc for dual CJS/ESM builds (dist/main and dist/module). No framework-specific dependencies — the framework-agnostic design is a real architectural constraint, not just marketing.

Code Quality — Test coverage is unusually strong for a library this size: cookies.spec.ts alone is 1,704 lines against 600 lines of implementation, and createServerClient.spec.ts/createBrowserClient.spec.ts closely mirror their respective source files line-for-line in scope. TypeScript types are exported explicitly via types.ts, and a warnDeprecatedPackage.ts module proactively nudges users still on the old auth-helpers packages.

API Design — The two-function surface (createServerClient, createBrowserClient) is deliberately minimal and mirrors the shape of supabase-js’s own createClient(), so migrating from the deprecated packages is largely a matter of swapping the import and wiring cookies. The README is candid about a real limitation (concurrent refresh-token races) rather than glossing over it, and documents the middleware-based mitigation — a level of honesty about edge cases that’s uncommon and genuinely useful for integrators.

Used by 13 apps in this directory

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python68%
TypeScript31%
Updated today
TypeScript
100%
AGPL 3.0

BaseBuddy

CMS

7

A self-hosted content editor for existing Postgres or Supabase schemas — maps the tables you already have into a WordPress-like TipTap editor instead of requiring you to reshape your database around a CMS.

View details
46
Repo Health
64
Technical
76
Dependency
Built with
TypeScript100%
Updated 1 weeks ago
TypeScript
96%

Finance

AI Assistants · Invoicing Finance

890

Bloomberg-grade financial data and AI-powered analysis through a conversational chat interface you can self-host.

View details
62
Repo Health
62
Technical
71
Dependency
Built with
TypeScript96%
Updated 1 weeks ago
TypeScript
99%
AGPL 3.0

fountain-ink

Blogging

64

A self-hostable, decentralized blogging platform built on Lens Protocol — own your content, audience, and distribution forever.

View details
26
Repo Health
66
Technical
69
Dependency
Built with
TypeScript99%
Updated 6 months ago
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

14,770

All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.

View details
56
Repo Health
78
Technical
72
Dependency
Built with
TypeScript96%
Updated 2 months ago
TypeScript
99%
Apache 2.0

Onlook

Design Tools · AI Design Tools

26,512

An open-source, AI-first visual editor that lets designers and developers build, style, and deploy React apps directly in code — no handoff required.

View details
66
Repo Health
80
Technical
68
Dependency
Built with
TypeScript99%
Updated 4 weeks ago
TypeScript
96%

Open Scouts

AI Agents · Automation

1,357

Create automated AI scouts that continuously search the web and send email alerts when they find what you're looking for.

View details
43
Repo Health
65
Technical
72
Dependency
Built with
TypeScript96%
Updated 2 months ago
TypeScript
84%
MIT

Plasmic

CMS · Low Code Platforms · No Code Platforms

6,961

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
65
Dependency
Built with
TypeScript84%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search