con un clic
sp-clerk
Use for Clerk provider guidance in this project.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Use for Clerk provider guidance in this project.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Use the Stripe Projects CLI in this repository to manage deploying and access to third party services.
Operate the Clerk CLI (`clerk` binary) for authentication, user/org/session management, instance config, env keys, and any Clerk Backend or Platform API call. Use when the user mentions Clerk management tasks, "list clerk users", "create a clerk user", "update organization", "pull clerk config", "clerk env pull", "clerk doctor", "clerk api", or any ad-hoc Clerk API request. Prefer the CLI over raw HTTP: it handles auth, key resolution, app/instance targeting, and formatting automatically.
| name | sp-clerk |
| description | Use for Clerk provider guidance in this project. |
Generated by stripe projects llm-context for Clerk.
Source: https://integrations.clerk.com/stripe/llm.md
Clerk is a drop-in authentication and user management platform. After provisioning a Clerk application, you'll have API keys to add sign-up, sign-in, and user management to any web or mobile app.
After provisioning, your credentials are in the CLERK_AUTH_ENVIRONMENTS environment variable as a JSON string:
{
"development": {
"publishable_key": "pk_test_...",
"secret_key": "sk_test_..."
},
"production": {
"publishable_key": "pk_live_...",
"secret_key": "sk_live_...",
"domain": "yourapp.com",
"dns_setup_required": true,
"dns_setup_url": "https://dashboard.clerk.com/..."
}
}
pk_test_ or pk_live_) — Used client-side. Safe to expose in frontend code.sk_test_ or sk_live_) — Used server-side. Keep secret — never expose in client code, git repos, or logs.production_domain was provided during provisioning. If dns_setup_required is true, visit the dns_setup_url to configure DNS before going live.Extract the keys from CLERK_AUTH_ENVIRONMENTS and set them as your framework expects. Use the development keys for local development.
Add to .env.local:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... # from development.publishable_key
CLERK_SECRET_KEY=sk_test_... # from development.secret_key
Add to .env:
VITE_CLERK_PUBLISHABLE_KEY=pk_test_... # from development.publishable_key
Add to .env:
CLERK_PUBLISHABLE_KEY=pk_test_... # from development.publishable_key
CLERK_SECRET_KEY=sk_test_... # from development.secret_key
When deploying, use the production keys instead:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_... # from production.publishable_key
CLERK_SECRET_KEY=sk_live_... # from production.secret_key
npm install @clerk/nextjs
middleware.ts (project root):
import { clerkMiddleware } from '@clerk/nextjs/server'
export default clerkMiddleware()
export const config = {
matcher: [
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
'/(api|trpc)(.*)',
],
}
app/layout.tsx:
import { ClerkProvider } from '@clerk/nextjs'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<ClerkProvider>
<html lang="en">
<body>{children}</body>
</html>
</ClerkProvider>
)
}
Protect a page:
import { auth } from '@clerk/nextjs/server'
export default async function ProtectedPage() {
const { userId } = await auth()
if (!userId) return <div>Not signed in</div>
return <div>Hello, {userId}</div>
}
npm install @clerk/clerk-react
import { ClerkProvider, SignedIn, SignedOut, SignInButton, UserButton } from '@clerk/clerk-react'
function App() {
return (
<ClerkProvider publishableKey={import.meta.env.VITE_CLERK_PUBLISHABLE_KEY}>
<SignedOut>
<SignInButton />
</SignedOut>
<SignedIn>
<UserButton />
</SignedIn>
</ClerkProvider>
)
}
npm install @clerk/express
import { clerkMiddleware, requireAuth } from '@clerk/express'
import express from 'express'
const app = express()
app.use(clerkMiddleware())
// Public route
app.get('/', (req, res) => res.send('Hello'))
// Protected route
app.get('/protected', requireAuth(), (req, res) => {
res.json({ userId: req.auth.userId })
})
app.listen(3000)
Clerk supports Remix, Vue, Nuxt, Fastify, Astro, and more. See https://clerk.com/docs/quickstarts for framework-specific guides.
When provisioning, you can pass:
Development credentials are returned by default. To get production credentials, pass production_domain during provisioning.