Skip to content

cunhabruno/clerk-nextjs-proxy-sample

Repository files navigation

NextJS pages router clerk proxy demo

This repo demonstrates how to setup Clerk to function as a "staging" environment running locally, by proxying Clerk frontend.

Getting started

ngrok

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

Clerk set up

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.

Start your app

Now you can start your app by running yarn dev and you will be able to access using your ngrok domain as URL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published