본문으로 건너뛰기
Skillpedia
보안33k · #8784

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/nextjs-supabase-auth/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. Use @supabase/ssr for App Router integration
  2. Handle tokens in middleware for protected routes
  3. Never expose auth tokens to client unnecessarily
  4. Use Server Actions for auth operations when possible
  5. 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.

repo: davila7/claude-code-templates

인기도

GitHub 스타
33k
순위
#8784
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬