惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
量子位
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog

Clerk Blog

Going to production with Clerk Deploy Clerk Init: The fastest way to start a new project Introducing Clerk CLI Middleware-based route protection bypass Postmortem: Clerk System Outage (March 10, 2026) Clerk for the AI era Add API Key support to your SaaS in minutes Postmortem: Clerk System Outage (February 19, 2026) Using Clerk in a React Native app Postmortem: DNS Provider Outage (February 10, 2026) How do I implement passkeys in Next.js? Clerk ranked #4 fastest-growing software vendor on Ramp’s December 2025 list How do I handle JWT verification in Next.js? Committing to Agent Identity: Clerk raises $50m Series C from Menlo and Anthropic’s Anthology Fund What is the best way to handle authentication in Next.js App Router? Postmortem: Database Incident (September 14–18, 2025) How do I add authentication to a Next.js app? Introducing Free Trials in Clerk Billing Postmortem: August 28, 2025 - elevated API latency and errors Introducing Mosaic: Bring Your Brand to Every Authentication Flow Multi-tenant authentication: What you need to know (and how Clerk helps) What are the risks and challenges of multi-tenancy? Resilience in Practice: Regional Failover at Clerk Build a Cross-Platform B2B App with Clerk, Expo, and Supabase Highlights from the MiduDev/Clerk Hackathon Add multi-tenancy to an app built with Clerk, Lovable, and Supabase How to build an AI coding rules app with Clerk, Lovable, and Supabase How to Build Multi-Tenant Authentication with Clerk Choosing the right SaaS architecture: Multi-Tenant vs. Single-Tenant Postmortem: June 26, 2025 service outage
How to take Clerk to Production
Alex Rapp · 2025-04-25 · via Clerk Blog

When you're building a modern web app, authentication is one of the first things to set up—and Clerk makes it incredibly fast. By default, your app starts with a development instance so you can test and build quickly. But to go live securely, you'll need a production instance.

Not sure when or how to switch? Let's walk through the differences and steps.

Related: Dev vs Prod Environment Guide

What's the Difference Between Dev and Production in Clerk?

Dev instances are optimized for speed:

  • Use shared OAuth credentials
  • Allow HTTP (great for localhost)
  • Minimal setup to get started

Production instances are secure by design:

  • Require HTTPS
  • Use dedicated credentials per provider
  • Authenticate under your own domain via DNS records

This setup reduces the risk of cross-site scripting and improves trust with your users.

Step-by-Step: Launching Your Clerk App in Production

1. Set Up Your Custom Domain

Before anything else, secure the domain where users will log in. Clerk uses this domain for identity verification and security. Related: Using Clerk with Custom Domains

2. Create a Production Instance in the Clerk Dashboard

Alt text: Clerk dashboard showing how to switch from a development instance to a production instance. The dropdown menu labeled “Development” is open, with a red arrow pointing to the “Create production instance” option. This step is part of promoting your app to production in Clerk.

  • Toggle from “Development” → Create production instance
  • Choose to clone or start fresh
  • Reconfigure any integrations that don't carry over (e.g., SSO)

Clerk gives you a helpful checklist after creation.

3. Add DNS Records for Verification

Alt Text: Clerk production instance dashboard displaying the initial setup checklist. It highlights required actions such as setting custom OAuth2 credentials and configuring CNAME records before deployment. Metrics for total users, active users, and deployment status (frontend not deployed, backend operational) are shown below.

Clerk provides DNS entries for:

  • Verifying domain ownership
  • Email authentication (SPF, DKIM, etc.)
  • Redirects/login under your domain

See docs: Custom Domain DNS Setup

4. Update Your API Keys

Alt Text: Clerk dashboard showing the API keys configuration page for a production instance. The screen displays the public "publishable key" (pk_live_...) for frontend use and a masked secret key under “default.” It also shows relevant deployment URLs, including the Frontend API, Backend API, and JWKS endpoint. A warning at the bottom reminds users that Clerk support will never ask for secret keys.

Each Clerk instance has its own key (Located under Configure > API Keys):

  • pk_live_ (publishable)
  • sk_live_ (secret)

Replace your .env values with the new production keys.

Docs: Environment Variables Reference

Clerk uses shared credentials in dev—but in production, you must register your app with each identity provider.

For example, when using Google:

  • Visit Google Cloud Console
  • Set up the consent screen + credentials
  • Add redirect URIs from your Clerk dashboard

Detailed walkthrough: Google OAuth with Clerk

Also see the full OAuth guide for other providers.

TL;DR: How to Go Live with Clerk