user-feedback: document CookieMethodsServer typing for strict TypeScript SSR setups

Open Beginner friendly
#348 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
90/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
next.js, typescript
Domain
documentation

Research direction

Open skill.md and find the Core principles / Supabase Documentation section. Add a short Next.js strict TypeScript SSR note covering an explicitly typed CookieMethodsServer adapter and individual set() calls when copying cookies to a replacement response. Done means the documented getAll/setAll pattern and NextResponse cookie limitation are clear.

Written by the indexing model from the issue text.

Description

What happened

Task: Fix a Next.js + @supabase/ssr session-cookie integration so a strict TypeScript gate (tsc --noEmit) passes while preserving the documented getAll / setAll SSR pattern.

Skill said: Follow the current Supabase SSR cookie adapter pattern. In a strict TypeScript project using @supabase/ssr 0.12.4, the inline cookie adapter lost contextual typing: setAll(cookiesToSet, headers) parameters became implicit any, destructured cookie fields became implicit any, and Object.entries(headers) values became unknown.

Expected: Mention that when contextual typing is lost, explicitly type the adapter as CookieMethodsServer exported by @supabase/ssr before passing it to createServerClient. This preserves the documented behavior and fixes the strict TypeScript errors without weakening types.

Also mention that current NextResponse.cookies typings do not provide a setAll() method; copying cookies to a replacement response should use individual set() calls.

Environment: Next.js 16.2.12, TypeScript 5.9.3, @supabase/ssr 0.12.4, @supabase/supabase-js 2.111.0.

Source

File: skill.md

Section: Core principles / Supabase Documentation

Fix suggestion

Add a short Next.js + strict TypeScript SSR note with an explicitly typed CookieMethodsServer adapter example.

Dominant language
TypeScript
Stars
2.6k
Forks
208
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/agent-skills

All issues in supabase/agent-skills

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.