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

clerk-auth

하는 일

이 스킬은 AI 에이전트가 앱에 Clerk 로그인을 추가하는 패턴을 제공합니다. Clerk으로 로그인, 가입, 경로 보호를 구현하려는 개발자를 위한 것입니다.

사용하는 경우

  • ✓Next.js 앱에 Clerk으로 로그인이나 가입을 추가하고 싶을 때.
  • ✓로그인한 사용자만 열 수 있도록 일부 페이지를 보호해야 할 때.
  • ✓서버 컴포넌트에서 현재 사용자를 가져오고 싶은 경우.

스킬 링크

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/clerk-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/clerk-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 앱에 Clerk 로그인을 추가하고 대시보드 페이지를 보호해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 Clerk의 프로바이더, 미들웨어, 기성 로그인 컴포넌트를 설정합니다. 그다음 헬퍼 함수로 서버에서 로그인한 사용자를 읽고 보호된 경로를 차단합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Clerk Authentication

Patterns

Next.js App Router Setup

Complete Clerk setup for Next.js 14/15 App Router.

Includes ClerkProvider, environment variables, and basic sign-in/sign-up components.

Key components:

  • ClerkProvider: Wraps app for auth context
  • <SignIn />, <SignUp />: Pre-built auth forms
  • <UserButton />: User menu with session management

Middleware Route Protection

Protect routes using clerkMiddleware and createRouteMatcher.

Best practices:

  • Single middleware.ts file at project root
  • Use createRouteMatcher for route groups
  • auth.protect() for explicit protection
  • Centralize all auth logic in middleware

Server Component Authentication

Access auth state in Server Components using auth() and currentUser().

Key functions:

  • auth(): Returns userId, sessionId, orgId, claims
  • currentUser(): Returns full User object
  • Both require clerkMiddleware to be configured

⚠️ Sharp Edges

Issue Severity Solution
Issue critical See docs
Issue high See docs
Issue high See docs
Issue high See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
Issue medium See docs
자주 묻는 질문

어떤 Next.js 버전을 다루나요?

App Router를 쓰는 Next.js 14와 15를 다룹니다.

어떤 기성 컴포넌트가 있나요?

SignIn, SignUp, UserButton 컴포넌트를 포함합니다.

웹훅도 다루나요?

네. 조직과 함께 웹훅 및 사용자 동기화도 다룹니다.

상세 정보

작성자의 원본 설명

Expert patterns for Clerk auth implementation, middleware, organizations, webhooks, and user sync Use when: adding authentication, clerk auth, user authentication, sign in, sign up.

repo: davila7/claude-code-templates

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬