Clerk environment variables
You can use environment variables to configure how your Clerk app behaves, such as where users are redirected after signing out of their account, or whether or not Clerk's telemetry should be enabled.
This page is a reference for all available Clerk environment variables.
Compatibility
In the frontend, Clerk's environment variables work for most popular meta-frameworks, such as Next.js or Remix.
If you're building a pure React app, you should use the props on the components you're using. For example, to force users to redirect to a specific URL after signing in, you would use the signInForceRedirectUrl
prop on <ClerkProvider>
rather than the CLERK_SIGN_IN_FORCE_REDIRECT_URL
environment variable.
Sign-in and sign-up redirects
Components, such as <ClerkProvider>
, <SignIn>
, and more, provide props for you to specify where users will be redirected. For example, <ClerkProvider>
has the signInFallbackRedirectUrl
and signUpFallbackRedirectUrl
props.
However, it's recommended to use environment variables instead of these props whenever possible.
For the FORCE
and FALLBACK
variables, it's recommended to define both sign-up and sign-in variables, as some users may choose to sign up instead after attempting to sign in, and vice versa.
Clerk Publishable and Secret Keys
To access your Clerk app in your local project, you must specify your app's Publishable Keys for use in the frontend, and Secret Keys for use in the backend.
You can find these keys on the API keys page in the Clerk Dashboard.
API and SDK configuration
The following environment variables enable you to configure API and SDK behavior, such as what version of the SDK your project uses, what proxy URL you use to connect to Clerk's Frontend API, and more.
Satellite domains
Clerk supports sharing sessions across different domains by adding one or many satellite domains to an application. See the satellite domains guide for more information.
Webhooks
The following environment variable allows you to protect your webhook signing secret. It is read by Clerk's verifyWebhook()
function.
Telemetry
Clerk provides environment variables for opting out of telemetry data collection. See the telemetry documentation for more information.
Deprecated
The following environment variables are deprecated but still supported to avoid breaking changes. Don't use them in new projects. It is recommended to switch to using the recommended alternatives in old projects.
Feedback
Last updated on