I’ve trying for days now to get Auth0 working with Nuxt 3 SSR. The vue-sdk is not configured to work with SSR causing multiple errors due to looking at window or document. I’ve also had to use server routes to redirect users to login because we need to send a user to the login from our application without route flashes or loginWithRedirect.
If anyone has been able to get Auth0 working with Nuxt and SSR please let me know your approach because I’ve had zero luck.
             
            
              
              
              
            
            
           
          
            
            
              Hi @scott.carlton
Welcome to the Auth0 Community!
I’m not a Nuxt expert, but while researching your question, I found that on the Nuxt roadmap, they don’t have a planned release for auth0 utils yet. However, they’ve provided the temporary repository → GitHub - atinux/nuxt-auth-utils: Add Authentication to Nuxt applications with secured & sealed cookies sessions., and it looks like it supports both SSR and Auth0. Did you have a chance to check this library?
Thanks
Dawid
             
            
              
              
              
            
            
           
          
            
            
              Dawid,
Thanks for the reply. I had looked at that module but thought it might not meet our use case. We don’t use a click event on a button to trigger the loginWIthRedirect that auth0 implements.
In our case a user that goes to our /login or /o/:slug for organizations is redirected via a server/routes/login or server/routes/o/[slug] file that does the redirect to auth0’s login flow base on a url string using the clientId, auth0 domain and any other requirements for that flow. This all appears to be working as expected.
The primary issue is when the user is redirect to /callback it continues to fail with a 500 issue a soon as i implement any sdk method and I’ve not been able to solve it gracefully with event with import.meta.client.
Thought I saw the Nuxt SDK package has been in discussion and on the roadmap since mid 2023 and was suppose to be supported Q3 2024 but has been moved out to Q3 2025.
             
            
              
              
              
            
            
           
          
            
            
              Hi team!
The first public beta of the Auth0 Nuxt SDK is now available for developers building web apps on the Nuxt framework!
Key Highlights
- Idiomatic Nuxt 3 Experience: Simple, composable functions (useAuth0) that feel native to Nuxt developers, dramatically reducing time-to-first-login.
- Advanced Security Out-of-the-Box: We’ve included support for the latest security standards from day one, including Pushed Authorization Requests (PAR), Rich Authorization Requests (RAR), and Backchannel Logout.
- Powerful API Authentication: Seamlessly obtain tokens for backend APIs using the TokenVault integration.
Resources
Here are the helpful resources to explore the new Nuxt SDK and get started:
This SDK is still in Beta and we need your feedback! Please share any feedback, questions or comments on GitHub.
Thanks!
Dawid