惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
H
Hacker News: Front Page
博客园_首页
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
V
V2EX
B
Blog RSS Feed
M
MIT News - Artificial intelligence
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
G
Google Developers Blog
D
Docker
T
Tor Project blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
P
Proofpoint News Feed
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
S
Schneier on Security
T
Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
T
The Exploit Database - CXSecurity.com
F
Fortinet All Blogs
A
About on SuperTechFans
Latest news
Latest news
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
H
Help Net Security
L
LINUX DO - 热门话题
A
Arctic Wolf
C
CERT Recently Published Vulnerability Notes
Security Latest
Security Latest
Spread Privacy
Spread Privacy
I
InfoQ
V
Vulnerabilities – Threatpost
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
Hacker News: Ask HN
Hacker News: Ask HN
腾讯CDC
大猫的无限游戏
大猫的无限游戏
P
Privacy & Cybersecurity Law Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
AWS News Blog
AWS News Blog
Cisco Talos Blog
Cisco Talos Blog
D
DataBreaches.Net
Simon Willison's Weblog
Simon Willison's Weblog

Supabase Blog

AI Agents Know About Supabase. They Don't Always Use It Right. Custom OIDC Providers for Supabase Auth 100,000 GitHub stars Supabase docs over SSH Navigating Regional Network Blocks Supabase Joins the Stripe Projects Developer Preview Log Drains: Now available on Pro Supabase Storage: major performance, security, and reliability updates Supabase incident on February 12, 2026 Hydra joins Supabase X / Twitter OAuth 2.0 is now available for Supabase Auth BKND joins Supabase Supabase is now an official Claude connector Supabase PrivateLink is now available Introducing: Postgres Best Practices When to use Read Replicas vs. bigger compute Introducing TRAE SOLO integration with Supabase Supabase Security Retro: 2025 Sync Stripe Data to Your Supabase Database in One Click Building ChatGPT Apps with Supabase Edge Functions and mcp-use Own Your Observability: Supabase Metrics API Introducing iceberg-js: A JavaScript Client for Apache Iceberg Introducing Supabase for Platforms Adding Async Streaming to Postgres Foreign Data Wrappers Build "Sign in with Your App" using Supabase Auth Introducing Seven New Email Templates for Supabase Auth The new Supabase power for Kiro Introducing Supabase ETL Introducing Analytics Buckets Introducing Vector Buckets Snap, Inc. Launches Snap Cloud, Powered by Supabase Triplit joins Supabase Supabase Series E 1000 Y Combinator Founders Choose Supabase gm 👋 web3, welcome aboard to Sign in with Web3 (Solana, Ethereum) Announcing the Supabase Remote MCP Server Enterprise speed, enterprise standards with Bolt Cloud + Supabase PostgREST 13 Lovable Cloud + Supabase: The Default Platform for AI Builders Processing large jobs with Edge Functions, Cron, and Queues Defense in Depth for MCP Servers OrioleDB Patent: now freely available to the Postgres community Supabase Launch Week 15 Hackathon Winner Announcement The Vibe Coder's Guide to Supabase Environments Testing for Vibe Coders: From Zero to Production Confidence The Vibe Coding Master Checklist Vibe Coding: Best Practices for Prompting Supabase Auth: Build vs. Buy Top 10 Launches of Launch Week 15 Supabase Launch Week 15 Hackathon Storage: 10x Larger Uploads, 3x Cheaper Cached Egress, and 2x Egress Quota Persistent Storage and 97% Faster Cold Starts for Edge Functions Algolia Connector for Supabase New Observability Features in Supabase Improved Security Controls and A New Home for Security Introducing Branching 2.0 Stripe-To-Postgres Sync Engine as standalone Library Supabase Analytics Buckets with Iceberg Support Create a Supabase backend using Figma Make Introducing JWT Signing Keys Supabase UI: Platform Kit Build a Personalized AI Assistant with Postgres Announcing Multigres: Vitess for Postgres Building on open table formats Open Data Standards: Postgres, OTel, and Iceberg Simplifying back-end complexity with Supabase Data APIs PostgreSQL Event Triggers without superuser access Top 10 Launches of Launch Week 14 Supabase MCP Server Data API Routes to Nearest Read Replica Declarative Schemas for Simpler Database Management Realtime: Broadcast from Database Keeping Tabs on What's New in Supabase Studio Edge Functions: Deploy from the Dashboard + Deno 2.1 Automatic Embeddings in Postgres Introducing the Supabase UI Library Supabase Auth: Bring Your Own Clerk Postgres Language Server: Initial Release Migrating from Fauna to Supabase Migrating from the MongoDB Data API to Supabase Dedicated Poolers Postgres as a Graph Database: (Ab)using pgRouting AI Hackathon at Y Combinator Calendars in Postgres using Foreign Data Wrappers Supabase Launch Week 13 Hackathon Winners How to Hack the Base! Running Durable Workflows in Postgres using DBOS database.build v2: Bring-your-own-LLM Restore to a New Project Hack the Base! with Supabase Top 10 Launches of Launch Week 13 Supabase Queues High Performance Disk Supabase Cron Supabase CLI v2: Config as Code Supabase Edge Functions: Introducing Background Tasks, Ephemeral Storage, and WebSockets Supabase AI Assistant v2 OrioleDB Public Alpha Executing Dynamic JavaScript Code on Supabase with Edge Functions ClickHouse Partnership, improved Postgres Replication, and Disk Management
Supabase is now compatible with Next.js 14
Jon Meyers · 2023-11-01 · via Supabase Blog

Supabase is now compatible with Next.js 14

As part of Next.js Conf 2023, the team at Vercel released Next.js 14. The huge headline feature was...

That's right, the headline feature is no new features!

This may sound underwhelming at first, but is incredibly good news for the stability of Next.js. This release comes with a huge number of performance and stability improvements—such as Server Actions being marked as stable. This means we can finally start promoting this fantastically simple way of authenticating users—entirely server-side!


_12

export default async function Page() {

_12

const signIn = async () => {

_12

'use server'

_12

supabase.auth.signInWithOAuth({...})

_12

}

_12

_12

return (

_12

<form action={signIn}>

_12

<button>Sign in with GitHub</button>

_12

</form>

_12

)

_12

}


With Server Components, fetching data in Next.js became as simple as:


_10

export default async function Page() {

_10

const { data } = await supabase.from('...').select()

_10

return ...

_10

}


With Server Actions, you can now place mutation logic alongside the Server Components responsible for fetching data and rendering the page:


_10

export default async function Page() {

_10

const { data } = await supabase.from('...').select()

_10

_10

const createNote = async () => {

_10

'use server'

_10

await supabase.from('...').insert({...})

_10

}

_10

_10

return ...

_10

}


To hear more about our thoughts on Next.js Conf and the release of Next.js 14, check out our Twitter space. Yuri, Alaister, Terry and myself talk through how we use Next.js at Supabase and what we personally found most exciting about Next.js Conf and the release of Next.js 14.

Yes, it is! So much so that Guillermo Rauch shouted us out in the keynote!

Since the release of the App Router—launched as beta with Next.js 13—we have been working closely with the team at Vercel to ensure that Supabase is fully compatible with every part of Next.js.

So for the App Router, that's:

And for the Pages Router:

So why does it require work on the Supabase side to make it compatible with Next.js?

By default, supabase-js uses localStorage to store the user's session. This works well for client-side apps, but will fail when you try to use supabase-js in a Server Component, as there is no concept of 'localStorage' on the server.

To do this, we need to configure supabase-js to use cookies instead of localStorage when running on the server. But this code is a little verbose to ask people to duplicate across every app they build with Supabase:


_19

const supabase = createClient(supabaseUrl, supabaseAnonKey, {

_19

auth: {

_19

flowType: 'pkce',

_19

autoRefreshToken: false,

_19

detectSessionInUrl: false,

_19

persistSession: true,

_19

storage: {

_19

getItem: async (key: string) => {

_19

cookieStore.get(key)

_19

},

_19

setItem: async (key: string, value: string) => {

_19

cookieStore.set(key, value)

_19

},

_19

removeItem: async (key: string) => {

_19

cookieStore.remove(key)

_19

},

_19

},

_19

},

_19

})


That takes care of the server-side pieces of Next.js, but since we recommend securing your apps with Row Level Security (RLS) policies, you can safely access your user's session client-side too. Therefore, we need to tell the browser how access that cookie too:


_21

const supabase = createClient(supabaseUrl, supabaseAnonKey, {

_21

auth: {

_21

flowType: 'pkce',

_21

autoRefreshToken: true,

_21

detectSessionInUrl: true,

_21

persistSession: true,

_21

storage: {

_21

getItem: async (key: string) => {

_21

return parse(document.cookie[key])

_21

},

_21

setItem: async (key: string, value: string) => {

_21

document.cookie = serialize(key, value)

_21

},

_21

},

_21

removeItem: async (key: string) => {

_21

document.cookie = serialize(key, '', {

_21

maxAge: 0,

_21

})

_21

},

_21

},

_21

})


That is a lot of very confusing code! So we decided to create a package called @supabase/ssr that does all of this for you. Then we took it one step further and created a Next.js and Supabase Starter Template, so you can just focus on building your awesome app! 🚀

Check out my Next.js Conf talk to see this starter template in action!

One command:


_10

npx create-next-app@latest -e with-supabase


The landing page will guide you through the process of creating a Supabase project and configuring your environment variables.

Build in a weekend on a Friday night! Scale to millions!

As you probably know, we love memes, so we are signing off with one about the least controversial commands coming out of Next.js Conf: