Install and configure Clerk SDK/CLI authentication. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check: notesBackend & APIs

Install Clerk Install Auth

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

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace clerk-install-auth --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-install-auth .claude/skills/clerk-install-auth && 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-install-auth
GitHub stars
2.8k
Token cost
~1.8k tokens
SKILL.md length
294 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Install and configure Clerk SDK/CLI authentication. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 6 steps: Install SDK for Your Framework → Configure Environment Variables → Add ClerkProvider (Next.js App Router) → …
  • Setting up a new Clerk integration
  • SKILL.md covers Overview, Prerequisites, Instructions and Error Handling, plus 5 more sections
  • Calls npm; needs NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY

What it does

Clerk Install Auth is an agent skill from jeremylongshore/tons-of-skills-marketplace. Install and configure Clerk SDK/CLI authentication. Use when setting up a new Clerk integration, configuring API keys, or initializing Clerk in your project. Trigger with phrases like "install clerk", "setup clerk", "clerk auth", "configure clerk API key", "add clerk to project".

Its SKILL.md is about 1.8k 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, Next.js and React. 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

  • Setting up a new Clerk integration
  • Configuring API keys
  • Initializing Clerk in your project
  • With phrases like install clerk

Example prompts

  • “install clerk”
  • “setup clerk”
  • “clerk auth”
  • “/clerk-install-auth”

Requirements

  • Node.js
  • 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:*), Bash(pnpm:*), Grep

Workflow steps

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

  1. Install SDK for Your Framework
  2. Configure Environment Variables
  3. Add ClerkProvider (Next.js App Router)
  4. Add Middleware
  5. Create Sign-In and Sign-Up Pages
  6. Verify Connection

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:*)
    • Bash(pnpm:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    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
    • PUBLISHABLE_KEY
    • VITE_CLERK_PUBLISHABLE_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 Install Auth loads about 1.8k tokens when it runs, and up to ~1.8k if it reads all its reference files. Until then it costs about 75 tokens; SKILL.md has 294 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:60
    # .env.local — never commit this file
  • NoteMentions a .env fileSKILL.md:71
    Ensure `.env.local` is in `.gitignore`:
  • NoteMentions a .env fileSKILL.md:74
    echo ".env.local" >> .gitignore
  • NoteMentions a .env fileSKILL.md:189
    r('Missing VITE_CLERK_PUBLISHABLE_KEY in .env')
  • NoteMentions a .env fileSKILL.md:229
    `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` to `.env.local` |
  • NoteMentions a .env fileSKILL.md:238
    (Vercel, AWS Secrets Manager), never in `.env` files committed to git

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). 294 words, ~1,806 tokens.

Download SKILL.mdSave it as .claude/skills/clerk-install-auth/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
clerk-install-auth
description
Install and configure Clerk SDK/CLI authentication. Use when setting up a new Clerk integration, configuring API keys, or initializing Clerk in your project. Trigger with phrases like "install clerk", "setup clerk", "clerk auth", "configure clerk API key", "add clerk to project".
allowed-tools
Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep
compatibility
Designed for Claude Code
version
1.15.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, clerk, api, authentication

Clerk Install & Auth

Overview

Set up Clerk SDK and configure authentication for Next.js, React, or Express. This skill covers SDK installation, environment variables, ClerkProvider, middleware, and initial auth verification.

Prerequisites

  • Node.js 18+
  • Package manager (npm, pnpm, or yarn)
  • Clerk account at dashboard.clerk.com
  • Publishable Key (pk_test_*) and Secret Key (sk_test_*) from Clerk Dashboard > API Keys

Instructions

Step 1: Install SDK for Your Framework
bash
set -euo pipefail
# Next.js (App Router or Pages Router)
npm install @clerk/nextjs

# React SPA (Vite, CRA, etc.)
npm install @clerk/clerk-react

# Express / Node.js backend
npm install @clerk/express

# Backend-only (Cloudflare Workers, serverless, etc.)
npm install @clerk/backend
Step 2: Configure Environment Variables
bash
# .env.local — never commit this file
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...

# Optional: routing URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/onboarding

Ensure .env.local is in .gitignore:

bash
echo ".env.local" >> .gitignore
Step 3: Add ClerkProvider (Next.js App Router)
typescript
// app/layout.tsx
import { ClerkProvider, SignInButton, SignedIn, SignedOut, UserButton } from '@clerk/nextjs'
import './globals.css'

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <ClerkProvider>
      <html lang="en">
        <body>
          <header className="flex justify-between p-4">
            <SignedOut>
              <SignInButton />
            </SignedOut>
            <SignedIn>
              <UserButton />
            </SignedIn>
          </header>
          {children}
        </body>
      </html>
    </ClerkProvider>
  )
}
Step 4: Add Middleware
typescript
// middleware.ts (project root, NOT inside app/ or src/app/)
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server'

// Define which routes should be publicly accessible
const isPublicRoute = createRouteMatcher([
  '/',
  '/sign-in(.*)',
  '/sign-up(.*)',
  '/api/webhooks(.*)',
])

export default clerkMiddleware(async (auth, req) => {
  if (!isPublicRoute(req)) {
    await auth.protect()
  }
})

export const config = {
  matcher: [
    // Skip Next.js internals and static files
    '/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
    // Always run for API routes
    '/(api|trpc)(.*)',
  ],
}
Step 5: Create Sign-In and Sign-Up Pages
typescript
// app/sign-in/[[...sign-in]]/page.tsx
import { SignIn } from '@clerk/nextjs'

export default function SignInPage() {
  return (
    <div className="flex min-h-screen items-center justify-center">
      <SignIn />
    </div>
  )
}
typescript
// app/sign-up/[[...sign-up]]/page.tsx
import { SignUp } from '@clerk/nextjs'

export default function SignUpPage() {
  return (
    <div className="flex min-h-screen items-center justify-center">
      <SignUp />
    </div>
  )
}
Step 6: Verify Connection
typescript
// app/api/health/route.ts
import { auth } from '@clerk/nextjs/server'

export async function GET() {
  const { userId } = await auth()
  return Response.json({
    clerkConnected: true,
    authenticated: !!userId,
    userId: userId || null,
  })
}
React SPA Setup (Vite)
typescript
// src/main.tsx
import { ClerkProvider } from '@clerk/clerk-react'
import App from './App'

const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY

if (!PUBLISHABLE_KEY) {
  throw new Error('Missing VITE_CLERK_PUBLISHABLE_KEY in .env')
}

ReactDOM.createRoot(document.getElementById('root')!).render(
  <ClerkProvider publishableKey={PUBLISHABLE_KEY}>
    <App />
  </ClerkProvider>
)
Express Setup
typescript
// server.ts
import express from 'express'
import { clerkMiddleware, requireAuth, getAuth } from '@clerk/express'

const app = express()

// Apply Clerk middleware globally — attaches auth to all requests
app.use(clerkMiddleware())

// Public route
app.get('/api/health', (req, res) => {
  res.json({ status: 'ok' })
})

// Protected route — redirects unauthenticated requests
app.get('/api/profile', requireAuth(), (req, res) => {
  const { userId } = getAuth(req)
  res.json({ userId })
})

app.listen(3001, () => console.log('Server running on :3001'))

Error Handling

ErrorCauseSolution
Missing publishableKeyEnv var not setAdd NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY to .env.local
ClerkProvider must wrap your applicationHook used outside providerEnsure ClerkProvider wraps root layout
auth() was called but Clerk can't detect clerkMiddleware()Middleware not runningPlace middleware.ts at project root, check matcher
Module not found: @clerk/nextjsPackage not installedRun npm install @clerk/nextjs
500 error on all pagesCLERK_SECRET_KEY missing or wrongVerify key prefix matches environment (sk_test_ for dev)

Enterprise Considerations

  • Use separate Clerk instances per environment (dev/staging/prod)
  • Store keys in platform secrets (Vercel, AWS Secrets Manager), never in .env files committed to git
  • The CLERK_SECRET_KEY must never be exposed client-side; only NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY is safe for browsers
  • For monorepos, install @clerk/nextjs only in the app that needs it; use @clerk/backend for shared server packages
  • Enable Clerk's "Enhanced email deliverability" in production for reliable transactional emails

Resources

Next Steps

Proceed to clerk-hello-world for your first authenticated request.

Output

  • Installed Clerk SDK/packages for the target stack
  • Auth routes/middleware wired and smoke-tested sign-in/sign-out
  • Documented env vars and local-dev secrets posture (never commit real keys)

Examples

Fresh install on Next.js
User: Install Clerk auth from zero on this Next.js repo.
Skill: adds dependencies, env template, middleware, and a protected smoke route.
Repair a half-finished install
User: Clerk packages are present but middleware never runs.
Skill: fixes matcher config, provider placement, and env loading order.

© 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-install-auth of jeremylongshore/tons-of-skills-marketplace.

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

Open the folder on GitHubat commit cfae287

Compare with similar skills

Clerk Install Auth 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 Install Auth compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clerk Install Auth this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.8kAutomated safety check: NotesMIT
Supabasecurvenote/curvenote1705 repos~2.2kAutomated safety check: PassCustom licence
Clerk Setupgrowupanand/ConvoForm102—~3kAutomated safety check: PassMIT
Fullstack DevHHU3637kr/skills1453 repos~8.6kAutomated safety check: NotesMIT
Clerk Nextjs Patternsgeekskai/blog1032 repos~2.1kAutomated safety check: PassMIT
Sign In With Google Webgoogle/skills21k—~4.1kAutomated safety check: PassApache-2.0

Similar skills

  • Supabase

    curvenote/curvenote

    A skill your agent uses when doing ANY task involving Supabase.

    170 GitHub starsUsed in 5 repos~2.2k tokens
    Backend & APIsAuto-check passed
  • Clerk Setup

    growupanand/ConvoForm

    Set up Clerk authentication in any project with the Clerk CLI and official framework quickstarts.

    102 GitHub stars~3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Fullstack Dev

    HHU3637kr/skills

    Full-stack backend architecture and frontend-backend integration guide.

    145 GitHub starsUsed in 3 repos~8.6k tokens
    Backend & APIsAuto-check: notes
  • Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.

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

    Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS / https://accounts.google.com/gsi/client) across web architectures.

    21k GitHub stars~4.1k tokensUpdated yesterday
    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

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

Categories

Questions about Clerk Install Auth

What does Clerk Install Auth do?

Install and configure Clerk SDK/CLI authentication. An agent skill from jeremylongshore/tons-of-skills-marketplace. Clerk Install Auth is an agent skill from jeremylongshore/tons-of-skills-marketplace. Install and configure Clerk SDK/CLI authentication.

When should I use Clerk Install Auth?

Clerk Install Auth fits situations like: setting up a new Clerk integration; configuring API keys; initializing Clerk in your project; with phrases like install clerk.

How do I install Clerk Install Auth in Claude Code?

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

How do I install Clerk Install Auth in Codex?

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

Can I use Clerk Install Auth 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-install-auth -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-install-auth, .gemini/skills/clerk-install-auth, .github/skills/clerk-install-auth and .opencode/skills/clerk-install-auth in your project.

What does Clerk Install Auth need to run?

Going by SKILL.md and its folder, Clerk Install Auth needs the command-line tools its instructions call (npm) and credentials named NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, PUBLISHABLE_KEY and VITE_CLERK_PUBLISHABLE_KEY. Our summary lists: Node.js; 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:*), Bash(pnpm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Clerk Install Auth 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 Install Auth safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Clerk Install Auth use?

Clerk Install Auth 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 Install Auth use?

About 1.8k tokens (SKILL.md is roughly 7.2k 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 Install Auth?

Skills that share tags, products or a category with Clerk Install Auth: Supabase (curvenote/curvenote, 170 stars), Clerk Setup (growupanand/ConvoForm, 102 stars), Fullstack Dev (HHU3637kr/skills, 145 stars) and Clerk Nextjs Patterns (geekskai/blog, 103 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clerk Install Auth?

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.