Create your first authenticated request with Clerk. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check passedBackend & APIs

Install Clerk Hello World

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-hello-world -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace clerk-hello-world --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/clerk-hello-world .claude/skills/clerk-hello-world && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clerk-hello-world
GitHub stars
2.8k
Token cost
~1.9k tokens
SKILL.md length
315 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Create your first authenticated request with Clerk. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 5 steps: Server Component — auth() and… → Protected API Route → Client Component with Hooks → …
  • Making initial API calls
  • SKILL.md covers Overview, Prerequisites, Instructions and Error Handling, plus 5 more sections
  • Needs NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY

What it does

Clerk Hello World is an agent skill from jeremylongshore/tons-of-skills-marketplace. 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".

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/quickstart-notes.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Authentication. It works with Clerk. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Making initial API calls
  • Testing authentication
  • Verifying Clerk integration works correctly
  • With phrases like clerk hello world

Example prompts

  • “clerk hello world”
  • “first clerk request”
  • “test clerk auth”
  • “/clerk-hello-world”

Requirements

  • A credential in NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • A credential in CLERK_SECRET_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Grep

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Server Component — auth() and currentUser()
  2. Protected API Route
  3. Client Component with Hooks
  4. Server Action with Auth
  5. Express.js Hello World

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • clerk.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
    • CLERK_SECRET_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Clerk Hello World loads about 1.9k tokens when it runs, and up to ~1.9k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 315 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 315 words, ~1,853 tokens.

Download SKILL.mdSave it as .claude/skills/clerk-hello-world/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
clerk-hello-world
description
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
compatibility
Designed for Claude Code
version
1.15.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, clerk, api, testing, authentication

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.

Prerequisites

  • Clerk SDK installed (clerk-install-auth completed)
  • Environment variables configured (NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY)
  • ClerkProvider wrapping application root
  • Middleware configured at project root

Instructions

Step 1: Server Component — auth() and currentUser()
typescript
// app/dashboard/page.tsx
import { auth, currentUser } from '@clerk/nextjs/server'
import { redirect } from 'next/navigation'

export default async function DashboardPage() {
  // auth() is lightweight — reads JWT from the session cookie, no API call
  const { userId } = await auth()

  if (!userId) redirect('/sign-in')

  // currentUser() makes a Backend API call — use sparingly, counts toward rate limit
  const user = await currentUser()

  return (
    <div>
      <h1>Hello, {user?.firstName || 'User'}!</h1>
      <p>User ID: {userId}</p>
      <p>Email: {user?.emailAddresses[0]?.emailAddress}</p>
      <p>Created: {user?.createdAt ? new Date(user.createdAt).toLocaleDateString() : 'N/A'}</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.

Step 2: Protected API Route
typescript
// app/api/hello/route.ts
import { auth } from '@clerk/nextjs/server'

export async function GET() {
  const { userId, orgId, sessionClaims } = await auth()

  if (!userId) {
    return Response.json({ error: 'Unauthorized' }, { status: 401 })
  }

  return Response.json({
    message: 'Hello from Clerk!',
    userId,
    orgId: orgId || null,
    sessionId: sessionClaims?.sid,
    timestamp: new Date().toISOString(),
  })
}
Step 3: Client Component with Hooks
typescript
'use client'
import { useUser, useAuth, useClerk } from '@clerk/nextjs'

export function AuthTest() {
  const { user, isLoaded, isSignedIn } = useUser()
  const { getToken, signOut } = useAuth()
  const { openUserProfile } = useClerk()

  if (!isLoaded) return <div>Loading...</div>
  if (!isSignedIn) return <div>Not signed in</div>

  const testAPI = async () => {
    // getToken() returns the session JWT — use for calling your own API routes
    // or external services with Bearer token auth
    const token = await getToken()
    const res = await fetch('/api/hello', {
      headers: { Authorization: `Bearer ${token}` },
    })
    const data = await res.json()
    console.log('API response:', data)
  }

  return (
    <div>
      <p>Signed in as: {user.primaryEmailAddress?.emailAddress}</p>
      <img src={user.imageUrl} alt="Avatar" width={48} height={48} />
      <div className="flex gap-2 mt-4">
        <button onClick={testAPI}>Test API</button>
        <button onClick={() => openUserProfile()}>Profile</button>
        <button onClick={() => signOut()}>Sign Out</button>
      </div>
    </div>
  )
}
Step 4: Server Action with Auth
typescript
// app/actions.ts
'use server'
import { auth } from '@clerk/nextjs/server'

export async function greetUser() {
  const { userId } = await auth()
  if (!userId) throw new Error('Unauthorized')

  // Perform server-side work here (DB queries, external API calls, etc.)
  return { greeting: `Hello user ${userId}!`, timestamp: new Date().toISOString() }
}
typescript
// app/dashboard/greeting.tsx
'use client'
import { greetUser } from '@/app/actions'
import { useState } from 'react'

export function GreetingButton() {
  const [msg, setMsg] = useState<string | null>(null)

  return (
    <div>
      <button onClick={async () => {
        const result = await greetUser()
        setMsg(result.greeting)
      }}>
        Get Server Greeting
      </button>
      {msg && <p>{msg}</p>}
    </div>
  )
}
Step 5: Express.js Hello World
typescript
import express from 'express'
import { clerkMiddleware, requireAuth, getAuth } from '@clerk/express'

const app = express()
app.use(clerkMiddleware())

// Public endpoint
app.get('/api/hello', (req, res) => {
  const { userId } = getAuth(req)
  res.json({
    message: userId ? `Hello user ${userId}!` : 'Hello anonymous!',
    authenticated: !!userId,
  })
})

// Protected endpoint — returns 403 if no valid session
app.get('/api/me', requireAuth(), (req, res) => {
  const { userId, orgId } = getAuth(req)
  res.json({ userId, orgId })
})

app.listen(3001)

Error Handling

ErrorCauseSolution
userId is nullUser not authenticatedRedirect to /sign-in or check middleware covers route
currentUser() returns nullSession expired or invalidRefresh page; ensure middleware is running
401 from API routeToken missing or expiredInclude Authorization: Bearer <token> header
Hydration mismatchServer/client state differsGuard client components with isLoaded check
auth() was called but Clerk can't detect clerkMiddleware()Middleware not in project rootMove middleware.ts out of app/ to project root

Enterprise Considerations

  • Use auth() over currentUser() in hot paths to avoid Backend API rate limits
  • Deduplicate currentUser() calls with React's cache() function across server components in the same request
  • For microservices, pass Clerk JWTs between services and verify with @clerk/backend or @clerk/express
  • Session token v2 (default since April 2025) uses a more compact format -- ensure downstream JWT consumers are updated
  • Custom session claims can be set in Dashboard > Sessions > Customize session token (limit: 1.2KB)

Resources

Next Steps

Proceed to clerk-local-dev-loop for local development workflow setup.

Output

  • Minimal Clerk "hello world" that signs in a user and shows identity on a protected page
  • Exact install + env steps for the chosen framework
  • Next-step links into deeper clerk-pack skills (webhooks, RBAC, production checklist)

Examples

Next.js hello world
User: Smallest possible Clerk + Next.js demo with a protected /me page.
Skill: scaffolds packages, middleware, sign-in UI, and /me reading user id.
Verify keys are live
User: Confirm publishable + secret keys work against Clerk API.
Skill: runs a minimal session/user fetch and reports success or key-mismatch errors.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/clerk-hello-world of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/quickstart-notes.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Clerk Hello World next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clerk Hello World compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clerk Hello World this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.9kAutomated safety check: PassMIT
Clerk Authdavila7/claude-code-templates33k5 repos~376Automated safety check: PassMIT
Clerk Nextjs Patternsgeekskai/blog1032 repos~2.1kAutomated safety check: PassMIT
Clerk AuthLeoYeAI/openclaw-master-skills2.2k—~6.1kAutomated safety check: NotesMIT
Clerkvvedantb/eva101—~510Automated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Clerk Auth

    davila7/claude-code-templates

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

    33k GitHub starsUsed in 5 repos~376 tokens
    Backend & APIsAuto-check passed
  • Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.

    103 GitHub starsUsed in 2 repos~2.1k tokens
    Backend & APIsAuto-check passed
  • Clerk Auth

    LeoYeAI/openclaw-master-skills

    Clerk auth with API Keys beta (Dec 2025), Next.js 16 proxy.ts (March 2025 CVE context), API version 2025-11-10 breaking changes, clerkMiddleware() options, webhooks, production considerations (GCP…

    2.2k GitHub stars~6.1k tokensUpdated 2 mo ago
    Backend & APIsAuto-check: notes
  • Clerk

    vvedantb/eva

    Clerk authentication router. An agent skill from vvedantb/eva.

    101 GitHub stars~510 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Clerk Hello World

What does Clerk Hello World do?

Create your first authenticated request with Clerk. An agent skill from jeremylongshore/tons-of-skills-marketplace. Clerk Hello World is an agent skill from jeremylongshore/tons-of-skills-marketplace. Create your first authenticated request with Clerk.

When should I use Clerk Hello World?

Clerk Hello World fits situations like: making initial API calls; testing authentication; verifying Clerk integration works correctly; with phrases like clerk hello world.

How do I install Clerk Hello World in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-hello-world -a claude-code`. Or copy the skill folder (skills/.curated/clerk-hello-world in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/clerk-hello-world in your project. Claude Code loads it when a task matches its description.

How do I install Clerk Hello World in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-hello-world -a codex`. Or copy the skill folder (skills/.curated/clerk-hello-world in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/clerk-hello-world in your project. Codex loads it when a task matches its description.

Can I use Clerk Hello World in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clerk-hello-world -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clerk-hello-world, .gemini/skills/clerk-hello-world, .github/skills/clerk-hello-world and .opencode/skills/clerk-hello-world in your project.

What does Clerk Hello World need to run?

Going by SKILL.md and its folder, Clerk Hello World needs credentials named NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY. Our summary lists: A credential in NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY; A credential in CLERK_SECRET_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Clerk Hello World access the network?

SKILL.md names 1 domain. As links in the text: clerk.com. This is read from the text; nothing was executed.

Is Clerk Hello World safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clerk Hello World use?

Clerk Hello World is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clerk Hello World use?

About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 40 tokens, read only when the agent opens those files.

What are the alternatives to Clerk Hello World?

Skills that share tags, products or a category with Clerk Hello World: Clerk Auth (davila7/claude-code-templates, 33k stars), Clerk Nextjs Patterns (geekskai/blog, 103 stars), Clerk Auth (LeoYeAI/openclaw-master-skills, 2.2k stars) and Clerk (vvedantb/eva, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clerk Hello World?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.