---
title: "Supabase is now compatible with Next.js 14"
description: "Supabase works across every Next.js 14 rendering context, including App Router Client and Server Components, Route Handlers, Server Actions and Middleware, plus the Pages Router data-fetching functions."
url: "https://swe.quest/articles/supabase-is-now-compatible-with-next-js-14-76a3d4ceac89740e"
canonical: "https://supabase.com/blog/supabase-is-now-compatible-with-nextjs-14"
source: "Supabase"
published: "2023-11-01"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 4
tags: ["react","frontend","identity-auth","javascript"]
---

# Supabase is now compatible with Next.js 14

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2023-11-01, 4 min read, Announcement. Original: [https://supabase.com/blog/supabase-is-now-compatible-with-nextjs-14](https://supabase.com/blog/supabase-is-now-compatible-with-nextjs-14)

## Summary

Supabase works across every Next.js 14 rendering context, including App Router Client and Server Components, Route Handlers, Server Actions and Middleware, plus the Pages Router data-fetching functions. Now that Server Actions are stable, auth and mutations can run entirely server-side next to the Server Components that fetch data. supabase-js stores sessions in localStorage by default, which doesn't exist on the server, so it has to be configured with cookie-based storage on both server and browser. The new @supabase/ssr package and a create-next-app starter template (\`-e with-supabase\`) wrap that boilerplate.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [React](https://swe.quest/tags/react.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- Next.js App Router ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- React Server Components ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))

## Keywords

Next.js 14, Supabase, Server Actions, @supabase/ssr, supabase-js, PKCE, Vercel

## Related posts

- [Introducing @supabase/server](https://swe.quest/articles/introducing-supabase-server-014f7e505754650d.md): Supabase · 2026-05-06 · Medium · 8 min read · Identity & auth, Serverless, TypeScript, Developer tools
  @supabase/server, now in public beta, replaces the repeated setup code found across 25,000 analyzed Edge Functions: client creation, JWT verification, claims parsing, CORS and auth wiring.
- [Fetching and caching Supabase data in Next.js 13 Server Components](https://swe.quest/articles/fetching-and-caching-supabase-data-in-next-js-13-server-components-3caa6b52da5f9612.md): Supabase · 2022-11-17 · Medium · 11 min read · React, Frontend, Caching, Real-time systems
  Next.js 13's app directory lets async Server Components query Supabase directly, with caching controlled by an exported \`revalidate\` value instead of separate getStaticProps/getServerSideProps functions.
- [supabase-js v2](https://swe.quest/articles/supabase-js-v2-f87cba2e3b41f9e9.md): Supabase · 2022-08-16 · Medium · 5 min read · JavaScript, TypeScript, API design, Identity & auth, PostgreSQL
  supabase-js v2 brings incremental quality-of-life changes over v1.
- [Using React Query with Next.js App Router and Supabase Cache Helpers](https://swe.quest/articles/using-react-query-with-next-js-app-router-and-supabase-cache-helpers-aaf0cb6afda9d12f.md): Supabase · 2024-01-12 · Medium · 7 min read · React, Frontend, Caching, TypeScript
  React Query can be paired with supabase-js in a Next.js App Router app by wrapping the root layout in a client-side QueryClientProvider and creating typed browser and server Supabase clients via @supabase/ssr.
- [Supabase Middleware: composable, reusable middleware for Web Fetch handlers](https://swe.quest/articles/supabase-middleware-composable-reusable-middleware-for-web-fetch-handlers-136b7931628c402b.md): Supabase · 2026-10-15 · Medium · 8 min read · TypeScript, Serverless, Identity & auth, API design, AI agents
  \`@supabase/middleware\` is an MIT-licensed, type-safe middleware engine for Web Fetch handlers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
