nextjs-supabase-auth
하는 일
이 스킬은 AI 에이전트에게 Next.js 앱에 Supabase 인증을 추가하는 전문 패턴을 제공합니다. Supabase로 로그인, 보호된 페이지, 세션을 만드는 개발자를 위한 것입니다.
사용하는 경우
- ✓Next.js App Router 앱에 Supabase 로그인이나 가입을 추가할 때.
- ✓로그인한 사용자만 열 수 있도록 페이지를 보호해야 할 때.
- ✓Supabase 로그인을 위한 OAuth 콜백 경로를 설정하려는 경우.
스킬 링크
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/nextjs-supabase-auth/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 Next.js 앱에 Supabase 이메일 로그인을 추가하고 대시보드 경로를 보호해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 각 맥락에 맞게 올바르게 설정된 Supabase 클라이언트를 만들고, 미들웨어에서 세션을 새로 고치며, OAuth 콜백을 처리해 코드를 세션으로 교환합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Next.js + Supabase Auth
You are an expert in integrating Supabase Auth with Next.js App Router. You understand the server/client boundary, how to handle auth in middleware, Server Components, Client Components, and Server Actions.
Your core principles:
- Use @supabase/ssr for App Router integration
- Handle tokens in middleware for protected routes
- Never expose auth tokens to client unnecessarily
- Use Server Actions for auth operations when possible
- Understand the cookie-based session flow
Capabilities
- nextjs-auth
- supabase-auth-nextjs
- auth-middleware
- auth-callback
Requirements
- nextjs-app-router
- supabase-backend
Patterns
Supabase Client Setup
Create properly configured Supabase clients for different contexts
Auth Middleware
Protect routes and refresh sessions in middleware
Auth Callback Route
Handle OAuth callback and exchange code for session
Anti-Patterns
❌ getSession in Server Components
❌ Auth State in Client Without Listener
❌ Storing Tokens Manually
Related Skills
Works well with: nextjs-app-router, supabase-backend
자주 묻는 질문
어떤 Supabase 패키지를 쓰나요?
App Router 연동을 위해 @supabase/ssr 패키지를 씁니다.
토큰은 어디서 처리해야 하나요?
스킬은 토큰을 미들웨어에서 처리하고, 클라이언트에 노출하지 않으라고 말합니다.
어떤 실수에 대해 경고하나요?
서버 컴포넌트에서 getSession을 쓰는 것과, 토큰을 직접 저장하는 것에 대해 경고합니다.
상세 정보
작성자의 원본 설명
Expert integration of Supabase Auth with Next.js App Router Use when: supabase auth next, authentication next.js, login supabase, auth middleware, protected route.
인기도
- GitHub 스타
- 33k
- 순위
- #8784
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
owasp-security
33k웹 앱, API, 모바일, 컨테이너, AI 에이전트를 위한 OWASP 보안 지침을 따르도록 해서, 흔한 약점을 찾고 수정안을 제안하게 합니다.
agent-management
33k에이전트가 AI Maestro 명령줄을 사용해 AI 에이전트를 만들고, 나열하고, 일시 정지하고, 깨우고, 이름을 바꾸고, 삭제하도록 돕습니다.
agent-messaging
33k에이전트가 Agent Messaging Protocol로 AI 에이전트 사이에 서명된 메시지를 보내고, 받고, 답하도록 돕습니다. 대부분 내 컴퓨터에서 작동합니다.
docs-search
33k에이전트가 자동 생성된 코드 문서에서 함수 시그니처, 클래스 정의, 주석을 검색하도록 해서, 코드를 바꾸기 전에 실제 API를 확인하게 합니다.