How to integrate auth0 with React Remix(SPA) or React Router v7

Is there any good examples of integration auth0 with React Remix(SPA) or React Router v7?

In Remix(SPA) or React Router v7, calling external api to GET or POST data are executed in clientLoader or clientAction, in my understanding.
So far, in React SPA app development, It has been quite common to use useAuth0 from @auth0/auth0-react to get idToken(JWT).
But useAuth0 is hooks, which is not be able to called in clientLoader and clientAction.
So I’m not sure what is the best way to integrate auth0 with Remix SPA or React Router v7.

3 Likes

Hi @retore404,

Welcome to the Auth0 Community!

I have reached out internally to confirm how to integrate Auth0 with Remix SPA/React Router v7. I will update you again when I hear back!

Thanks,

Mary Beth

Hi @marybeth.hunter ,

Thanks for your response.
I’m looking forward to get the answer!

Thanks.

1 Like

Hi @retore404,

I have heard back from the team! Currently, we do not have a Quickstart for Remix. An Engineer is going to make one, however. He told me to expect an update by next Wednesday, January 8. I will follow up with him then and update you here again!

Thanks,

Mary Beth

1 Like

@marybeth.hunter
Thank you for sharing.

1 Like

If your REST backend is written with Spring and if you anticipate that your app will need to scale you might be interested in the solution in this Baeldung article: OAuth2 clients are stateful (they store tokens) and the Spring ecosystem includes Spring Session to share this state across instances, and stuff like Actuator for observability that you definitely want in prod.

1 Like

Its Wednesday January 8th, checking back to see if there’s a new example for Remix/React-Router v7 :slight_smile: (and keeping this post alive for at least another 2 weeks?)

1 Like

+1 for tutorial on React-Router v7 + auth0.

Hi all,

Thanks for your patience!

The PM updated me and said that based on his investigation, this looks like a longer task involving efforts across multiple teams. He has added this to our Q1 backlog.

Best,

Mary Beth

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.