clerk-environments-deployment
БесплатноБез исполняемых скриптовНе проверенUse for Clerk dev/prod readiness, deployment, and multi-language implementation planning. PROACTIVELY activate for environment variables, pk_test/sk_test vs…
от JosiahSiegel★ 67 звёзд на GitHubОб этом скилле
Clerk Environments, Deployment, and Multi-Language Checklists
Overview
Use this skill when the task is broader than a single framework: development vs production setup, deployment readiness, custom domains, DNS, redirects, CORS/cookies, webhooks, CSP, monitoring, incident response, or multi-language backend architecture.
Clerk integrations often work locally and fail in production because keys, domains, redirects, OAuth credentials, webhook secrets, proxy headers, or CSP are environment-specific. Treat environment design as part of the auth implementation, not a deployment afterthought.
Environment Model
Use separate Clerk instances for development and production. For staging/preview, decide explicitly whether to use a separate staging Clerk instance or a constrained development instance. Avoid sharing a production instance with untrusted preview URLs unless there is a strong reason and hardened allowlists.
Key prefixes are a fast sanity check:
| Key type | Development | Production | Exposure |
|---|---|---|---|
| Publishable key | pk_test_... |
pk_live_... |
Client-safe |
| Secret key | sk_test_... |
sk_live_... |
Server-only |
| Webhook signing secret | whsec_... |
whsec_... per endpoint/instance |
Server-only |
| Encryption key | random secret | random secret | Server-only |
Never mix pk_test_ with sk_live_, pk_live_ with sk_test_, or webhook secrets from another endpoint/instance.
Local Development Checklist
- Use
.env.local/local secret storage for dev keys only. - Confirm framework variable names: e.g.
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYfor Next.js client exposure andCLERK_SECRET_KEYfor server-only use. - Configure local sign-in/sign-up routes and fallback redirects.
- Use the Clerk CLI where useful: setup/init, env pull, and deploy status checks.
- For webhooks, expose the local app with a tunnel and create a development webhook endpoint using the tunnel URL.
- Keep local webhook signing secrets separate from production secrets.
- Test signed-out, signed-in, wrong-role, wrong-org, and webhook replay flows locally.
- Do not commit
.envfiles, logs with tokens, or tunnel URLs that imply private infrastructure. - Confirm NTP is enabled on the dev host and inside any Docker/WSL2 containers; clock drift causes spurious
token-not-active-yet/token-expirederrors. For container time resync recipes (WSL2timedatectl, Docker Desktop restart,docker exec date -s), load theclerk-clock-skew-jwtskill.
Preview and Staging Checklist
Preview deployments introduce dynamic hosts. Decide how those hosts map to Clerk settings.
- Use non-production keys for untrusted preview branches.
- Configure allowed origins/redirect URLs for the preview host pattern where the platform and Clerk support it.
- Avoid giving every preview URL production OAuth credentials or production webhook access.
- Confirm cross-origin APIs accept the preview origin in CORS.
- Confirm cookies and SameSite behavior match the preview domain topology.
- If previews call a shared backend, ensure the backend accepts only the intended Clerk instance(s) and token issuers.
- Keep preview webhook endpoints separate, or route them to isolated test queues/databases.
Production Launch Checklist
Before going live:
- Create or select a production Clerk instance.
- Set production environment variables in the hosting platform; do not deploy with development keys.
- Configure production domains in Clerk Dashboard.
- Add required DNS records for session management and domain-verified emails.
- Replace development/shared OAuth credentials with provider-owned production credentials.
- Configure sign-in/sign-up URLs, after-auth fallback/force redirects, and allowed redirect origins.
- Configure production webhook endpoints and use the production endpoint's signing secret.
- Configure custom domain/proxy settings if the app cannot use Clerk's Frontend API CNAME.
- Add CSP directives for Clerk scripts, frames, connections, images, and styles if CSP is enabled.
- Configure subdomain allowlists and
authorizedPartiesfor cross-subdomain safety. - Verify reverse proxies/CDNs forward auth-relevant headers.
- Run direct API tests with and without Bearer tokens.
- Run a webhook delivery/replay test.
- Verify logs redact tokens, cookies, session IDs, webhook signatures, and secret keys.
- Document rollback steps and secret-rotation steps.
Clerk production keys use pk_live_ and sk_live_. DNS propagation can take time, so schedule domain validation before launch.
Domains, DNS, Custom Domains, and Proxying
Production Clerk domains require DNS access. Clerk uses DNS records for session management and domain-verified emails. If using Cloudflare, certain Clerk validation records may need DNS-only mode so validation can complete.
When a Frontend API CNAME cannot be added, use Clerk's documented proxy option. Validate:
- Frontend SDK points at the correct proxy/custom domain.
- Nex
Установить clerk-environments-deployment в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл clerk-environments-deployment?
Use for Clerk dev/prod readiness, deployment, and multi-language implementation planning. PROACTIVELY activate for environment variables, pk_test/sk_test vs pk_live/sk_live, local dev, preview/staging/prod instances, domains/DNS, redirects, OAuth credentials, custom domains/proxy, authorizedParties, CSP, CORS/cookies, webhooks/tunnels, Vercel/Netlify/Cloudflare/API gateways, monitoring/troubleshooting, and backends in Node/Express/Fastify, Python/FastAPI/Django/Flask, Go, Ruby/Rails, Java/Spring, .NET, PHP/Laravel. Provides checklists, rollout plans, and language-portable patterns.
Как установить скилл clerk-environments-deployment?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл clerk-environments-deployment запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic