This repo demonstrates how to setup Clerk to function as a "staging" environment running locally, by proxying Clerk frontend.
In order to setup Clerk with a proxy you will need to expose your localhost server with a service like ngrok, acquire a free ngrok account and create the env variables with the respective values as in the yarn script ngrok
then you can run the same command:
NGROK_AUTH_TOKEN="YOUR_CLERK_AUTH_TOKEN" NGROK_DOMAIN="YOUR_NGROK_DOMAIN" yarn ngrok
Setup your clerk application, then follow the Clerk documentation step 3 only, to setup the proxy.
Also take a look into the .env.example
and create a .env.local
with the same env variables with its respective values.
Now you can start your app by running yarn dev
and you will be able to access using your ngrok domain as URL.