Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(docs): update nextjs quickstart (#28404)

Charisb0313a262e18
diff --git a/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx b/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx
index 83917c4fc10..0fe94cd5c12 100644
--- a/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx
+++ b/apps/docs/content/guides/getting-started/quickstarts/nextjs.mdx
@@ -137,23 +137,16 @@ hideToc: true
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
- get(name: string) {
- return cookieStore.get(name)?.value
+ getAll() {
+ return cookieStore.getAll()
},
- set(name: string, value: string, options: CookieOptions) {
+ setAll(cookiesToSet) {
try {
- cookieStore.set({ name, value, ...options })
- } catch (error) {
- // The `set` method was called from a Server Component.
- // This can be ignored if you have middleware refreshing
- // user sessions.
- }
- },
- remove(name: string, options: CookieOptions) {
- try {
- cookieStore.set({ name, value: '', ...options })
- } catch (error) {
- // The `delete` method was called from a Server Component.
+ cookiesToSet.forEach(({ name, value, options }) =>
+ cookieStore.set(name, value, options)
+ )
+ } catch {
+ // The `setAll` method was called from a Server Component.
// This can be ignored if you have middleware refreshing
// user sessions.
}