Import Repo
Apps Using Clerk Auth in Tempo
If you have a react app that uses clerk for authentication, follow these steps to get your app to run correctly
- In the env variables use your development keys which allow your app to be hosted on any domain
- You must host the sign-in and sign-up pages on your react app (rather than using accounts.your.domain which is hosted on Clerk). Use the Clerk sign in and sign up components.
- In env variables (or clerk provider), set the sign in and sign up URLs to be the relative path so that it uses the same domain as where the dev server is hosted (https://clerk.com/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects)
-
E.g.
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
,NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
-
For Vite use
VITE_CLERK_SIGN_IN_URL
&VITE_CLERK_SIGN_UP_URL
-
For the ClerkProvider, set the props:
-
- Open
app.tempo-dev.app
. This is the same Tempo app but hosted on the same domain as the dev server. This allows Clerk to pass the Cookie into the inner iframe. - Find the same project you set up above and open the canvas.
- Restart the dev server if it was running before, and to log in to the app open the main storyboard in a new tab by clicking the external link icon on the storyboard header. Log in there then refresh the whole page back in Tempo.
It should all work after that!