Create your first authenticated request with Clerk.
Use when making initial API calls, testing authentication,
or verifying Clerk integration works correctly.
Trigger with phrases like "clerk hello world", "first clerk request",
"test clerk auth", "verify clerk setup".
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Create your first authenticated request with Clerk.
Use when making initial API calls, testing authentication,
or verifying Clerk integration works correctly.
Trigger with phrases like "clerk hello world", "first clerk request",
"test clerk auth", "verify clerk setup".
allowed-tools
Read, Write, Edit, Bash(npm:*), Grep
version
1.14.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
["saas","clerk","api","testing","authentication"]
compatibility
Designed for Claude Code, also compatible with Codex and OpenClaw
Clerk Hello World
Overview
Make your first authenticated requests using Clerk across server components, client components, API routes, and server actions. Validates your Clerk integration end-to-end.
Step 1: Server Component — auth() and currentUser()
// app/dashboard/page.tsximport { auth, currentUser } from'@clerk/nextjs/server'import { redirect } from'next/navigation'exportdefaultasyncfunctionDashboardPage() {
// auth() is lightweight — reads JWT from the session cookie, no API callconst { userId } = awaitauth()
if (!userId) redirect('/sign-in')
// currentUser() makes a Backend API call — use sparingly, counts toward rate limitconst user = awaitcurrentUser()
return (
<div><h1>Hello, {user?.firstName || 'User'}!</h1><p>User ID: {userId}</p><p>Email: {user?.emailAddresses[0]?.emailAddress}
Created: {user?.createdAt ? new Date(user.createdAt).toLocaleDateString() : 'N/A'}
)
}
</p>
<p>
</p>
</div>
Key distinction:auth() is cheap (JWT parsing, no network). currentUser() is expensive (Backend API call, rate-limited). Prefer auth() when you only need userId, orgId, or sessionClaims.