Staging alternatives

Shared production credentials


This is not recommended. Instead, you should either set up a staging environment with a separate domain or use a preview deployment.

If you do not want to purchase a separate domain, or if you would like to share settings and data between your production and staging environments, you can use a subdomain of your production domain to set up a staging environment.

Limitations of using a subdomain

The limitations of using a subdomain to set up a staging environment with Clerk include:

  • You will be combining staging data with live production data.
  • When you enable Clerk features to test in staging, they will be enabled in your Production environment as well.

Set up staging with a subdomain

  1. Add your subdomain to your hosting provider - Ensure that your subdomain is associated with your staging branch so that it will point to new staging deployments. This process will vary based on your provider. The following are some guides from popular hosting providers:
  2. Add your CNAME record to your domain provider - Depending on the provider, the verification process for this can take hours or days.
  3. Add your production instance API keys to your staging deployment - In your staging deployment's environment variables, add your Clerk app's production instance API keys. Visit the API Keys section in the Clerk Dashboard to find them, and ensure that the instance at the top of the Dashboard is set to Production. The following are environment variable guides from some popular providers:


What did you think of this content?