# Auth0 SDK for Nuxt 3

**URL:** <https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085>\
**Category:** Product Feedback\
**Tags:** sdk\
**Created:** [March 22, 2023, 3:53pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085 "2023-03-22T15:53:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![awacode21](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/awacode21/32/42426_2.png) [@awacode21](https://community.auth0.com/u/awacode21)\
**Post date:** [March 22, 2023, 3:53pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/1 "2023-03-22T15:53:53Z")

</div>

**Feature:** Please provide an auth0 SDK for Nuxt 3

**Description:** / **Use-case:**  
My customers application should use Nuxt 3 with Server Side Rendering.  
The customers authentication provider is Auth0.  
We are currently migrating to Nuxt3, but are experiencing Auth0 to block this task 100%.

Unfortunatly Auth0 still does not provide any SDK for Nuxt. It provides one for Next.js. So i would like to ask if their shouldn’t also be one for Nuxt, as Nuxt meanwhile is widely used in the vue community.

I need to support server side rendering with auth0. So already on the server i need to know if the user is logged in or not and have access to the token for server side api calls. I need to know this information on both, client and server.  
Also i need to be able to use custom login/register page.  
But there is no SDK, no documentation, no example. Simply nothing that helps us getting Auth0 running with Nuxt 3.

In past with Nuxt 2 there was a nuxt module to handle authentication but it is not compatible with nuxt 3. For nuxt 3 there is non official module yet, which make it even worse that Auth0 is providing nothing to use their service with nuxt.

There is one community package (from sidebase) one can use, but it is only working client side, seem to not provide custom login/register pages and end up in weird issues because of some internal conflicts with nuxt. Its also only a wrapper arount next.js to get it somehow working for nuxt. This is far away from ideal and no solution with our requirements.

So currently the missing support of Auth0 for Nuxt is blocking our Migration to Nuxt. Everything else would work totally fine. This is really annoying and a big problem for us.

So i would like to left my request here for an Auth0 SDK for nuxt, or any guidance on how to implement it with Nuxt with SSR and custom login/register.

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 23, 2023, 9:44am UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/2 "2023-03-23T09:44:07Z")

</div>

Hey there!

Thanks @awacode21 for raising that! I can already see that it got two votes which is good, basically the more votes it will receive the more likely our engineering team will implement that. We review those feedback cards on a monthly basis and will let you know once we have any updates on that front!

---

<div class="post-metadata">

**Author:** ![awacode21](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/awacode21/32/42426_2.png) [@awacode21](https://community.auth0.com/u/awacode21)\
**Post date:** [May 10, 2023, 3:15pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/3 "2023-05-10T15:15:26Z")

</div>

@konrad.sopala As this still is a really big issue for us (btw a very big company using your service) i would like to ask if you got already enough votes to work on this or if it is still in state “don’t know if we ever will work on it”?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 11, 2023, 7:34am UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/5 "2023-05-11T07:34:46Z")

</div>

Hey there @awacode21 !

Just reached out to our SDK team regarding that. Once I receive the answer will make sure to relay the information here.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 11, 2023, 8:33am UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/6 "2023-05-11T08:33:35Z")

</div>

In the meantime that we wait for their answer it seems that [https://sidebase.io/nuxt-auth](https://sidebase.io/nuxt-auth) which, according to some github issues seems to work with Auth0 on Nuxt3 [[nitro] [dev] [uncaughtException] TypeError: Auth0Provider is not a function · Issue #271 · sidebase/nuxt-auth · GitHub](https://github.com/sidebase/nuxt-auth/issues/271)

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 17, 2023, 1:13pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/7 "2023-05-17T13:13:00Z")

</div>

Just received a response from the SDK Team Product Manager.

Nuxt is something that we’ve been keeping tabs on. We don’t have any immediate plans unfortunately but its something that we will be looking at deeper most likely in Q3 when we explore more framework expansions with our existing SDKs.

---

<div class="post-metadata">

**Author:** ![awacode21](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/awacode21/32/42426_2.png) [@awacode21](https://community.auth0.com/u/awacode21)\
**Post date:** [June 16, 2023, 3:55pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/8 "2023-06-16T15:55:45Z")

</div>

@konrad.sopala  
Regarding the sidebase plugin:  
Sadly this plugin seems to be broken somehow for auth0. We tried for long time to get it running but we needed to stop our whole nuxt migration because of the lack of Auth0 support. The sidebase plugin is not delivering the whole user objects data which should be delivered, it also only delivers somekind of invalid/broken token. We are unable to work with it. The needs of my customer where not able to solve with that plugin. So we really need the official SDK to be safe with our user authentication.

Quite sad that lack of auth0 support hinders us in going with this amazing framework.  
We thought about finding a solution on our own writing something with openid connect. But the whole topic and documentation was so unclear and confusing that we postponed the whole thing.

---

<div class="post-metadata">

**Author:** ![colton](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/colton/32/46001_2.png) [@colton](https://community.auth0.com/u/colton)\
**Post date:** [June 18, 2023, 6:02am UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/10 "2023-06-18T06:02:02Z")

</div>

Bummer that this isn’t on your immediate to-do list. Was considering use Auth0 for my OAuth and OpenID Connect needs, but i may need to go else where.

---

<div class="post-metadata">

**Author:** ![prodoxx](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prodoxx/32/50683_2.png) [@prodoxx](https://community.auth0.com/u/prodoxx)\
**Post date:** [September 8, 2023, 1:02pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/11 "2023-09-08T13:02:36Z")

</div>

I also need this. If Auth0 isn’t going to make this anytime soon or see it as a priority, I’ll try to do a community version of it.

There is a SDK for NextJs but non of Nuxt3?

---

<div class="post-metadata">

**Author:** ![ctrl-Felix](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ctrl-felix/32/51217_2.png) [@ctrl-Felix](https://community.auth0.com/u/ctrl-Felix)\
**Post date:** [September 27, 2023, 7:01pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/12 "2023-09-27T19:01:31Z")

</div>

Q3 is over soon. Are there any news on tihs?

---

<div class="post-metadata">

**Author:** ![biketag](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@biketag](https://community.auth0.com/u/biketag)\
**Post date:** [November 16, 2023, 7:41pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/14 "2023-11-16T19:41:15Z")

</div>

**EDIT:**  
It looks like the Nuxt team is recommending other solutions, and has not yet finished their internal module for authentication:

> <https://github.com/nuxt-community/auth-module/issues/893>
>
> \### Nuxt 3 support
> 
> Nuxt 3 comes with built-in utilities to support session an…d authentication. We are working on a new official module. Meanwhile, we recommend: 
> 
> \- \[Sidebase Nuxt Auth\](https://github.com/sidebase/nuxt-auth) based on next-auth
> \- \[AuthJs Nuxt\](https://github.com/Hebilicious/authjs-nuxt) based on Auth.js
> \- Implement your own auth using \[Lucia\](https://lucia-auth.com/guidebook/sign-in-with-username-and-password/nuxt/) or \[Nuxt Auth Template\](https://github.com/nuxt/examples/tree/main/auth/local)
> 
> \----
> 
> Idea of auth module started back into 2017 as a way to standardize API authorization flow with nuxt applications using store state (almost same time we introduced \_modules\_ concept to nuxt it was one of examples). By the time passing usage of module and varieties went way further of what it was initially designed to be.
> 
> Having a provider agnostic auth module is a really complicated problem:
> \- Every auth provider has specific requirements and setup even when following standards like Oauth2
> \- Non implicit authentication flows require a backend API to be also configured properly (like laravel or passport)
> \- There is still no standard way to have universal state for nuxt applications
> \- Isomorphic http requests require properly configured endpoints for server-side rendering and proxy
> \- With static generated websites, we need to partially hydrate on client-side
> \- Documentation area needs more attention for each provider
> 
> Simply saying there was no solution (with current design) to make every project happy
> 
> By each of last five major releases, we tried to adopt with new requirements and nuxt updates but still module is buggy because of complexities above and legacy code-base and almost impossible to accept new contributions without breaking changes -- one fix break another usage.
> 
> With \[v5 project\](https://github.com/nuxt-community/auth-module/projects/3) and HUGE help of @JoaoPedroAS51 we started with a major typescript rewrite to improve architecture of module. Yet still there are framework requirements to complete v5 rewrite:
> \- Built-in support for API routes in Nuxt framework (WIP)
> \- Standard way to handle sessions (@nuxt/session WIP)
> \- Partially auth state hydration for SSGs
> 
> Considering current status, auth module is not a stable or well-documented solution but also it doesn't means project is forgotten. We are trying hard to fill in the gap for missing core components for v5.
> 
> Some alternative packages suggested to make your own auth solution:
> \- \[cookie-universal-nuxt\](https://github.com/microcipcip/cookie-universal/tree/master/packages/cookie-universal-nuxt)
> \- \[http-module\](https://http.nuxtjs.org)
> 
> \*\*Update:\*\* Status page added to docs https://auth.nuxtjs.org/status
> \*\*Update:\*\* Thanks for all DMs for helping \<3 Any help on docs is more than welcome via PRs
> 
> Regards and thanks for your patience 💚

With that, there is no straightforward authentication strategy for Auth0 and Nuxt. There is an @auth0/auth0-vue package. I am wondering how much work it would be to implement a Nuxt module for this? @konrad.sopala

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 17, 2023, 10:34am UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/15 "2023-11-17T10:34:05Z")

</div>

Hey there!

Following up on that with our SDKs team. Will share an update as soon as I have more context from them. Thank you!

---

<div class="post-metadata">

**Author:** ![odm](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/odm/32/54883_2.png) [@odm](https://community.auth0.com/u/odm)\
**Post date:** [February 15, 2024, 2:44pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/16 "2024-02-15T14:44:50Z")

</div>

@konrad.sopala Any news regarding official SDK for Nuxt3?

---

<div class="post-metadata">

**Author:** ![ah\_nova](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ah_nova/32/56357_2.png) [@ah\_nova](https://community.auth0.com/u/ah_nova)\
**Post date:** [April 11, 2024, 7:43pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/17 "2024-04-11T19:43:05Z")

</div>

Are there any updates? Have the devs started working on this?

---

<div class="post-metadata">

**Author:** ![timotheeduran](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/timotheeduran/32/52526_2.png) [@timotheeduran](https://community.auth0.com/u/timotheeduran)\
**Post date:** [April 24, 2024, 7:38am UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/18 "2024-04-24T07:38:31Z")

</div>

@konrad.sopala Hello! Any updates on this?

---

<div class="post-metadata">

**Author:** ![Wazbat](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wazbat/32/56741_2.png) [@Wazbat](https://community.auth0.com/u/Wazbat)\
**Post date:** [April 28, 2024, 4:56pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/19 "2024-04-28T16:56:06Z")

</div>

It’s a shame there’s no updates on this. Though I think at this point there’s other mature providers

---

<div class="post-metadata">

**Author:** ![rzouhair](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rzouhair/32/56867_2.png) [@rzouhair](https://community.auth0.com/u/rzouhair)\
**Post date:** [May 4, 2024, 8:46pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/20 "2024-05-04T20:46:52Z")

</div>

Hello! I haven’t tested this solution thoroughly, but this is the approach I took to set it up in my nuxt app

in `plugins/auth0.ts` I added auth0 to the vue app:

```auto
import { createAuth0 } from "@auth0/auth0-vue";

export default defineNuxtPlugin((nuxtApp) => {
  const runtimeConfig = useRuntimeConfig()

  const auth0 = createAuth0({
    domain: runtimeConfig.public.auth0url,
    clientId: runtimeConfig.public.auth0client,
    ...otherOptions,
  });

  if (process.client)
    nuxtApp.vueApp.use(auth0)
})

```

then added the auth guard to a route middleware as follows:

```auto
import { createAuthGuard } from "@auth0/auth0-vue";

export default defineNuxtRouteMiddleware(async(to, from) => {
  if (!isAuthenticated()) {
    return await createAuthGuard()(to); 
  }
})

```

in my users’ pinia store, I added useAuth0 composable and exported states I needed:

```auto
import { defineStore } from "pinia";
import { useAuth0 } from "@auth0/auth0-vue";

export const useUserStore = defineStore('user', () => {
  const {
    isAuthenticated,
    logout: authLogout,
    loginWithRedirect,
    error,
    user: userProfile,
  } = useAuth0();
  const userId = computed(() => userProfile.value?.sub);

  async function logout() {
    await authLogout({
      logoutParams: { returnTo: window?.location.origin }
    });
  }

  return {
    isAuthenticated,
    userProfile,
    userId,
    error,

    logout,
    login: async () => {
      await loginWithRedirect()
    },
  };
});

```

I used the users’ store across the app, and navigation guard seems to be working based on the authentication state.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![k4ben](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/k4ben/32/57030_2.png) [@k4ben](https://community.auth0.com/u/k4ben)\
**Post date:** [May 11, 2024, 4:53pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/21 "2024-05-11T16:53:41Z")

</div>

a) Where is `isAuthenticated` defined in the middleware?  
b) Seems to work if I reference the useUserStore() with ssr disabled, but not sure how to access the vue plugin from nuxt ssr (is this even possible)?

“Cannot destructure property ‘isAuthenticated’ of ‘ **vite\_ssr\_import\_2**.useAuth0(…)’ as it is undefined.”

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 18, 2024, 8:19pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/22 "2024-06-18T20:19:23Z")

</div>

Hey all! Just a quick update here to share that an official Nuxt SDK is on the roadmap - While I’m unable to share an exact date at this time, the team plans to look at releasing a beta version of the SDK beginning in Q3 2024+.

Stay tuned!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 2, 2024, 8:19pm UTC](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085/23 "2024-07-02T20:19:38Z")

</div>

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

[Next page](https://community.auth0.com/t/auth0-sdk-for-nuxt-3/103085.md?page=2)
